#include <stdio.h>
int main()
{
int a[5];
printf("%p\n%p\n",a+1,&a[1]);
return(0);
}
When the above code is built and run. The output is:
0029ff00
0029ff00
Then when i change the 5th line from a + 1
to &a + 1
#include <stdio.h>
int main()
{
int a[5];
printf("%p\n%p\n",&a+1,&a[1]);
return(0);
}
The output is:
0029ff10
0029ff00
what is being referred to when i include the ampersand (&
) and does it have to do with the format specifier %p
?