Simple char assignment not working in CUDA
问题 Please look at the below code which does a simple char assignment __global__ void seehowpointerwork(char* gpuHello, char* finalPoint){ char* temp; bool found = false; for(int i = 0 ; i < 11; i++){ if(gpuHello[i] == ' '){ temp = &gpuHello[i+1]; found = true; break; } } bool sth = found; finalPoint = temp; } int main() { // Testing one concept; string hello = "Hello World"; char* gpuHello; cudaMalloc((void**)&gpuHello, 11 * sizeof(char)); cudaMemcpy(gpuHello, hello.c_str(), 11 * sizeof(char),