Youtube RSS Feed
Learn with Vikas Suhag
Array of pointers in C Language
Mar 06, 2022   Vikas Suhag

#include <stdio.h>
const int MAX = 3;
int main ()
{
int  var[] = {10, 100, 200};
int i, *ptr[MAX];
for ( i = 0; i < MAX; i++)
{
      ptr[i] = &var[i]; /* assign the address of integer. */
}
for ( i = 0; i < MAX; i++)
{
      printf("Value of var[%d] = %d\n", i, *ptr[i] );
}  
return 0;
}

 


Leave a Comment

* Email will not be published.
All comments are only visible after approval.
Most Viewed articles
Search
Subscribe to Email Updates
Vikas Suhag

I am Engineer, Developer, Teacher, Blogger, Vlogger, Traveller, Photographer...

I have been developing websites, writing blogs and recording videos during my travel while being a full tim ...

Youtube Channel
Podcast
Subscribe to Email Updates
Connect With Us
Youtube RSS Feed
© 2022 Learn with Vikas Suhag. All Rights Reserved.