The pointer address in c code example
Example 1: how to print the address of a pointer in c
int a = 42;
printf("%p\n", (void *) &a);
Example 2: poiner in c
int* pc, c, d;
c = 5;
d = -15;
pc = &c; printf("%d", *pc); // Output: 5
pc = &d; printf("%d", *pc); // Ouptut: -15
Example 3: poiner in c
int c, *pc;
// pc is address but c is not
pc = c; // Error
// &c is address but *pc is not
*pc = &c; // Error
// both &c and pc are addresses
pc = &c;
// both c and *pc values
*pc = c;