title: How to return a single variable from a CUDA kernel function?
body: <p>I have a CUDA search function which calculate one single variable. How can I return it back.</p>
  
  <pre><code>__global__ 
  void G_SearchByNameID(node* Node, long nodeCount, long start,char* dest, long answer){
      answer = 2;
  }
  
  cudaMemcpy(h_answer, d_answer, sizeof(long), cudaMemcpyDeviceToHost);
  cudaFree(d_answer);
  </code></pre>
  
  <p>for both of these lines I get this error:
  error: argument of type "long" is incompatible with parameter of type "const void *"</p>