I have a pointer to an array of two structures. The structure is:

Code:
==in some header.h==
typedef struct 
{

  float distX;
  float distY;
  float veloX;
  float veloY;

} ObjList_t;
and the array is defined as:

Code:
==in some file.c==
static MeasObjList_t Objects_g[MAX]; //MAX = 2
In my function, I have the pointer defined as:
Code:
extern MeasObjList_t Objects_g[MAX];

void foo(void){
MeasObjList_t (* ptrMeasObjs)[MAX] = &measObjects_g;

...
This works out perfectly fine when I have to access ptrMeasObjs[0]->distX but the second structure in the array is not being initialized when I access ptrMeasObjs[1]->distX. Im using MSVC++ and when I look in the Autos window while debugging I see the following when I init ptrMeasObjs[1]->distX to 10

Code:
void foo(void){
   MeasObjList_t (* ptrMeasObjs)[MAX] = &measObjects_g;
   ptrMeasObjs[1]->distX = 10.0f;

   if (ptrMeasObjs[1]->distX >=5.0f){
      count++; //never gets here
   }
Code:
- ptrMeasObjs
  +[0]
  -[1]
        distX = 10.000
        distY = 0.000
        veloX = 0.000
        veloY = 0.000
      
- ptrMeasObjs[1]
  +[0]
  -[1]
        distX = 0.000
        distY = 0.000
        veloX = 0.000
        veloY = 0.000

ptrMeasObjs[1]->distX = 0
ptrMeasObjs[1]->distY = 0
ptrMeasObjs[1]->veloX = 0
ptrMeasObjs[1]->veloY = 0

When I just access ptrMeasObjs[0]->distX, it looks like:
Code:
void foo(void){
   MeasObjList_t (* ptrMeasObjs)[MAX] = &measObjects_g;
   ptrMeasObjs[0]->distX = 10.0f;

   if (ptrMeasObjs[0]->distX >=5.0f){
      count++; //gets here this time
   }
Looks good in the debugger and it gets to the count inside the loop
Code:
- ptrMeasObjs
  -[0]
        distX = 10.000
        distY = 0.000
        veloX = 0.000
        veloY = 0.000

  -[1]
        distX = 0.000
        distY = 0.000
        veloX = 0.000
        veloY = 0.000
      
- ptrMeasObjs[0]
  -[0]
        distX = 10.000
        distY = 0.000
        veloX = 0.000
        veloY = 0.000

  -[1]
        distX = 0.000
        distY = 0.000
        veloX = 0.000
        veloY = 0.000

ptrMeasObjs[0]->distX = 10
ptrMeasObjs[0]->distY = 0
ptrMeasObjs[0]->veloX = 0
ptrMeasObjs[0]->veloY = 0
Why is ptrMeasObjs being listed twice in the debugger? And why with the change in elements of the array does it not work as anticipated for the second half of my array? According to the debugger, it looks like its close, but not quite. What am I doing wrong here?