I'm new to c language. This is my code
char c[]="name";
char *p="city";
printf("\n 1. memory location of array in pointer is %u",p);
p=c;
printf("\n 2. memory location of array in pointer is %u",p);
it gives me output :
memory location of array in pointer is 177
memory location of array in pointer is 65518
now checkout the difference in memory allocation, when first time
char *p="city"
address in p is 177 and second time when
p=&c;
address in p is 65518. why? I didn't get the address allocation to array. Normally when declare some variable in c, there address is something like 655... and at the time char *p, its different. Is there any specific reason for this.
I'm working on windows 7 32 bit operating system
My question is when
char *p="city"
address in p is 177. why?