What is an array of pointers. Explain with examples - counter
Sponsored Links


Popular Links


List of Abbreviations

National Highways in India

States & Union Territories of India

Currency of All Countries

What is an array of pointers. Explain with examples

You are Here: Home > Computer Subjects > Programming in C Language > …

What is an array of pointers. Explain with examples.

Ans. A pointer is a variable that contains the memory location of another variable. The values you assign to the pointers are memory addresses of other variables. We can assign pointers as an array of pointer with the following syntax:

 data_type *pointer_name[size]

Example

     main()
     {
          int *arr[2];
          int a = 3, b = 5;
          int i;

          arr[0] = &a;
          arr[1] = &b;

          for (i=0; i< 2; i++)
          {
                  printf("The value of %d= %d ,address is %u\t \n", i, *(arr[i]),arr[i]);
          }

          return 0;
     }

Click Here to Find Latest Jobs and Current Affairs
Updated: May 31, 2013 — 2:05 pm

1 Comment

Add a Comment
  1. thank u for the help

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2016. All Rights Reserved. WikiIND.com