c - Pointers addresses behaviour -


this question has answer here:

for example:

int *ptr 

what's difference beetween &ptr , ptr because when

printf("ptr= %d  &ptr=%d",ptr,&ptr); 

the result not same.

ptr pointer value (it's address).

&ptr address of pointer object.

to print pointer value have use:

printf("ptr= %p  &ptr=%p", (void *) ptr, (void *) &ptr); 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -