c how to print address of pointer code example
Example 1: how to print the address of a pointer in c
int a = 42;
printf("%p\n", (void *) &a);
Example 2: how to print a pointer array in c
#include <stdio.h>
int main() {
int data[5];
printf("Enter elements: ");
for (int i = 0; i < 5; ++i)
scanf("%d", data + i);
printf("You entered: \n");
for (int i = 0; i < 5; ++i)
printf("%d\n", *(data + i));
return 0;
}