Вот модифицированная версия вашего кода с комментариями в printfs.Обратите внимание, что я добавил третий printf для ссылки на ваш int
в p
#include<stdio.h>
int main(){
int p=10;
int *i=&p;
printf("'i' = %p is the address of the int stored in variable p\n",(void *)i);
printf("'&i' = %p is the address of the pointer to an int called i\n",(void *)&i);
printf("'*i' = %d is the int that is stored at the location in i which points to p\n",*i);
}
'i' = 0x7ffee4e63abc is the address of the int stored in variable p
'&i' = 0x7ffee4e63ab0 is the address of the pointer to an int called i
'*i' = 10 is the int that is stored at the location in i which points to p