Hi everybody,
I have this line of code:
Code:
sizeInputPtr++;
if(sizeInputPtr >= sizeArray+sizeof(int)*MAXARRAYSIZE) {
sizeInputPtr = sizeArray;
}
I was having a problem where it seems sizeInputPtr never resets so I checked the values using watch in MSVC .NET 2003 and this is what I got:
Code:
sizeArray 0x00321558 int [20]
0x00321558+(sizeof(int)*20) 0x003215a8 unsigned int
sizeArray+(sizeof(int)*20) 0x00321698 int [20]
MAXARRAYSIZE is defined as being 20 using
#define MAXARRAYSIZE
It does not make sense to me.
The first line says that the array of integers sizeArray start at address 0x00321558
The second line is to test what is the end address of the array which seems to be correct at address 0x003215a8. 20 integers = 80 bytes.
The third line is confusing since it should give me the same value as the second line but it's much more.
If any guru out there could lend a hand in understanding this, I'd appreciate. Thanks a lot,
Amish