Determine length of an array
How do you determine the length of an array? For example:
unsigned char HillsData[163840];
When I use:
DebugTest[3] = sizeof(HillsData);
I get 4 rather than 163840. I'd like to know how you determine the size of an array, as to prevent overflow. The image, for example, is 1024x40 pixels at 32-bit color. If one bothers to modify it to 1024x48 at the same color depth, array overflow would occur because it's reading more data than the array has available. If it was reduced to 1024x32 instead, then the image would not have array overflow when loaded.
In short, how do you determine the length of an array (how many elements it has)?