C Pointers

Array of Pointers

In this chapter of this C tutorial, we will learn about 'array of pointers'.



data-type *array-name[expression];

expression - is the number of elements to be taken in the array.

  • The square bracket over here will take the precedence over the '*' operator.
  • Each element in array-name will hold a pointer to the data-type.


#include <stdio.h>
void main () 
    char *names[5] = 
    int i;
    for ( i = 0; i < 5; i++) 
         printf("Value of names[%d] = %s\n", i, names[i] );


Value of names[0] = Nikhil
Value of names[1] = Muskaan
Value of names[2] = Suraj
Value of names[3] = Aarti
Value of names[4] = Usman

Please Share this page
Views : 32
Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!