I am using 3rd party code, which has type defined as:
typedef float MarkerData[3];
later in the code, I have array of this marker position data referenced as:
MarkerData* Markers;
I am using this code to iterate this array:
for (int32 s = 0; s < totalMarkers; s++)
{
MarkerData* mData = (Markers + s);
markerPosition.X = *(mData)[0];
markerPosition.Y = *(mData)[1];
markerPosition.Z = *(mData)[2];
}
The code does not crash, but float values get mixed. From debug I can see, that I properly get markerPosition.X value on every iteration, but Z and Y are taken from other array. I suppose I am using wrong pointer arithmetic here, but no matter what, can not figure it out. This typedef really is new to me, and I don't know - what might be off?