this question has answer here:
- why can't treat array pointer in c? 1 answer
in system, undefined pointer has default value of 0x00000000.
void demo() { char cdata; char *pexampleptr; char pexamplearray[4]; &cdata <--- address 0x12345678 pexampleptr <--- value of pointer 0x00000000 pexamplearray[0] <--- address ??? } what default address of pexamplearray? 0x00000000 or have valid address cdata?
the pointer pexampleptr indeed have valid address. maybe meant is not pointing , hence 0x00000000 that's not case.
also in regards pexamplearray[4], array, not pointer , indeed have vaild address case first variable.
Comments
Post a Comment