In this program, you will learn to display array elements using array of pointers. “Array of pointers” is an array of the pointer variables. It is also known as pointer arrays. Syntax: int *var_name[array_size]; We can make separate pointer variables which can point to the different values or we can make one integer array of pointers that can point to all the values.
# include<stdio.h>
void main()
{
int *arr[4];
int i=31, j=5, k=19, l=71, m;
arr[0] = &i;
arr[1] = &j;
arr[2] = &k;
arr[3] = &l;
for (m=0; m<=3; m++)
printf("%d\n", *(arr[m]));
getch();
}
31
5
19
71