/* File: pointer.c Obtain the address of a variable and assigned it to a pointer */ #include int main() { int i, *p; /* declare i as int, p as pointer to int */ i = 10; /* i is assigned with 10 */ p = &i; /* p is assigned with the address of i. p points to i */ printf("The value of i is %d\n", i); printf("The address of i is %p\n", &i); printf("The value of p is %p\n", p); return 0; }