C Array address confusion -


suppose have following code:

main () {   char string[20];    printf(" string %s \n " , &str); } 

what printf(" string %s \n " ,&str); give?

suppose str points location 200, &str give??

not sure want, according question title, might want know couple of things array addresses:

 main () {   char string[20];   char *str = &string;    printf("the string addr %p \n" , &string);   printf("the string addr %p \n" , &string[0]);   printf("the string addr %p \n" , str);   printf("the string addr %p \n" , &str[0]); } 

all these equivalent ways address of "array". address of array address of first element of array.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -