Pointer memory allocation

why the size of pointer is 8 insead of 4 bytes(size of int)

size of pointer will be 4 not 8
where you are checking ?
send me the screen shot

image
here sizeof(a) is coming 8 in the output.

for me output is 4

send me your complete code

yes in ide it is giving wrong ans
try on your local machine

may be it is because of 64-bit compiler
image
this is the whole code

so , the correct answer should awlays be 4, right?irrespective of the type of pointer

yes 4 is correct ans irrespective of pointers

1 Like