int main(int argc, char *argv[])
{
char b[]="Among Us";
char* string2 = &b[0];
printf("Print address of b\t\t= %p\n", &b[0]);
printf("Print content of string2\t= %p\n", string2);
printf("Print content of string2\t= %s\n", string2); // why ???
system("PAUSE");
return 0;
}
Why does the last printf show us the content of b? Isn't it supposed to show us the address of b but in %s format?
I thought printf("Print content of string2\t= %s\n", *string2);
was the correct method of getting the content of b printed out through string2 but apparently it was the wrong way.