title: cudaMemcpy - copy an int from host to device error
body: <p>What is the difference between </p>
  
  <pre><code> cudaMemcpy and cudaMemset??
  </code></pre>
  
  <p>How can I copy an int value from host to device?
  This is the code I am using</p>
  
  <pre><code>int addXdir = 1;
  int devAddXdir;
  cudaMalloc((void**)&amp;devAddXdir, sizeof(int));
  cudaMemcpy(devAddXdir, addXdir, sizeof(int), cudaMemcpyHostToDevice);
  </code></pre>
  
  <p>it gives the following errors
      error: argument of type "int" is incompatible with parameter of type "void *"
      error: argument of type "int" is incompatible with parameter of type "const void *"</p>