C++ Program to Access Elements of an Array Using Pointer

C++ Program to Access Elements of an Array Using Pointer The article is a lively article because it contains interesting information and your favorite.   

C++ Program to Access Elements of an Array Using Pointer

C++ Program to Access Elements of an Array Using Pointer

#include <iostream>
using namespace std;

int main()
{
   int data[5];
   cout << "Enter elements: ";

   for(int i = 0; i < 5; ++i)
      cin >> data[i];

   cout << "You entered: ";
   for(int i = 0; i < 5; ++i)
      cout << endl << *(data + i);

   return 0;
}

Read Also: C++ Program to Swap Numbers in Cyclic Order Using Call by Reference

Final Words

I hope you find the article C++ Program to Access Elements of an Array Using Pointer uses. The reason is that we have told you all the information through this article in a way that you can understand. And if you have any doubts, you can express your doubts through the comment box. We also ask that you help share this article with your friends.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment