sizeof(myArray) should return the total size of the array in bytes. knowing this, and that the array is totally composed of integers and that each integer is 4 bytes, you can figure out how many items are in the array.
sizeof(myArray) / sizeof(int) = # of items in the array.
Are you using c or c++? If C++, then you should probably use vectors for storing a variable number of elements. Even if you are unable to use vectors, that array must be getting resized in your code somewhere...you should be able to determine the new number of elements using the information used to resize the array.
microchip, you're right! sizeof works in compile time. If you send the array pointer to a function and ask for sizeof this pointer, you'll get the sizeof the pointer (32/64 bit 4 or 8 bytes depending the machine) thus it will return 4 or 8 in this case. But if your sizeof call see the actual array declaration (thus they are in the same scope) then the sizeof will not convert the array identifier to a pointer, and returns the array size IN BYTES.