A89: Arrays
[Prev][Next][Index][Thread]
A89: Arrays
I was trying to use pointer arithmetic in my current program, in order to
find the different parts of an array holding a sprite. The array is made up
of unsigned shorts, so I used sizeof(unsigned short)*TILE_HEIGHT, where
TILE_HEIGHT is the number of elements in that part of the array, to find the
size. However, the sprite wouldn't display correctly. Using sprintf, I found
this to be 32 bytes. However, when I subtracted the address of the array
parts, it was shown as 16 bytes. The sprites will only be displayed right
if I add 16 bytes to the base address, so I believe this to be right. Why
isn't this 32 bytes?
References: