Here's a part of my program.
I understand how s1 works but i am confused with s2
char* s1="string";
char s2[7]="string";
printf( "\n &s2 is :%p",&s2);
printf("\n\n s2 is :%p",s2);
printf( "\n *s2 is :%c",*s2);
Output
&s2 is :0018FF48 //i.e. s2 is contained in memory address 0013FF48
s2 is :0018FF48 //i.e s2 points to 0013FF48
*s2 is :s //i.e value contained in 0013FF48 is s
This is summarized below and I can't figure out it's meaning:
- s2 is contained in 0018FF48, s2 contains 0018FF48 and address no 0018FF48 contains 's'
what role actually s2 is playing?