When I execute the next code
int main()
{
char tmp[] = "hello";
printf("%lp, %lp\n", tmp, &tmp);
return 0;
}
I had got the same addresses. But for the next code, they will be different
int main()
{
char *tmp = "hello";
printf("%lp, %lp\n", tmp, &tmp);
return 0;
}
Could you explain the memory differences between those examples?