A pointer is a variable that store the address of another variable direct address of the memory location. Thus, the variable can be type of int, char , array, function or any other pointer. Variable or constant you must declare a pointer before using it to store any variable address.However, in 32-bit architecture the size of a pointer is 2 byte.
The following example to define a pointer which stores the address of an integer
int*p = &n;
Declaring a pointer
In C language pointer can be declared using * (asterisk symbol).
Let’s see the example of pointer
int Var = 10;
int *ptr = &Var;
printf("Value of Var = %d\n", *ptr);
printf("Address of Var = %p\n", ptr);
*ptr = 20;
printf("After doing *ptr = 20, *ptr is %d\n", *ptr);
Value of Var = 10
Address of Var = 0x7fffa057dd4
After doing *ptr = 20, *ptr is 20