Mask-group

Declaring a Pointer



int *a; //pointer to int

char *c; //pointer to character

Example 1:

Output:

Example 2:

We can also have a pointer to a pointer.

Output:

In the above example, i is an int variable,j is a pointer to an integer and k is a pointer to an integer pointer.We can also create a pointer to a pointer to an integer pointer and so on.

When one pointer variable stores the address of another pointer variable it is known as double pointer (pointer to pointer variable).