I wrote this to test my knowledge on pointers:
int main (){
int seven = 7;
int* p = &seven;
int** pp = &p;
int*** ppp = &pp;
printf("%d %d %d %d\n", *ppp, &pp, &p, &seven);
}
However, in the output, I get:
1363848032 1363848024 1363848032 1363848044
This is unintuitive to me because *ppp == &p
I was expecting *ppp == &pp. Why is this happening? Does the &pp follow the pointer to p?
"%p"format specifier for printing pointer addresses! also, return something from main (as it has to returnint), to be pedantic returnEXIT_SUCCESSfromstdlib.h, and last but not least, eather writeint main(void)orint main(int argc, const char *argv[])