title: IntPtr Address increment (not value)
body: <p>I have a C++ DLL which has got functions to send data from a device. From my managed C# code i call the C++ function positionCallback. Here notice the pos. pos as per definition-is Array of three pointers, pointing to arrays of positions.</p>
  
  <pre><code>public void positionCallback(uint devNo,uint count,uint index,ref System.IntPtr pos,ref System.IntPtr mrk)
  </code></pre>
  
  <p>Now my issue is i want to extract the data of each of those 3 arrays but i can only get the data for Array 1 and for rest 2 i am getting garbage value.
  Below is the code i am trying</p>
  
  <pre><code> // Copy the unmanaged array to managed memory for Axis 2
  IntPtr ptr2 = IntPtr.Add(pos,2*sizeof(Int64));
   Marshal.Copy(pos,managedArrayAxis1,0,(int)count);
   // Copy the unmanaged array to managed memory for Axis 2
   Marshal.Copy(ptr2, managedArrayAxis2, 0, (int)count);
  </code></pre>
  
  <p>Above code is giving correct data only for managedArrayAxis1 but for managedArrayAxis2, garbage data is collecting. Am i wrongly incrementing IntPtr address for pos?</p>
  
  <p>Please help!</p>