hello everybody,
What is the memory allocated by the following definition ?
int (*x)[10];
srinu
with regards
This is a discussion on c/c++ programming within the C++ Programming forums, part of the General Programming Boards category; hello everybody, What is the memory allocated by the following definition ? int (*x)[10]; srinu with regards...
hello everybody,
What is the memory allocated by the following definition ?
int (*x)[10];
srinu
with regards
srinu
Well, you would assume that x would be a line of ten integers, but it's not. * declares it as a pointer. All pointers are DWORDs, meaning that they are 32 bit variables (on the x86 instruction set). Each 32 bit variable is 4 bytes and it holds a value up to 0xFFFFFFFF, or 4,294,967,295. 10 of then would be 40 bytes, and that is how much is allocated.int (*x)[10];
-Mike
{InFeStEd-ArCh0n}