SabirSazzad

Pointer Array

Feb 26th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int arr[3],i;
  7.     int *p;
  8.     p = arr;
  9.     cout << "Input Array Elements...."<<endl;
  10.     for(i=0; i<3; i++)
  11.     {
  12.         cin >> *(p+i);
  13.     }
  14.     cout << "Array Elements excess by Pointer..."<<endl;
  15.     for(i=0; i<3; i++)
  16.     {
  17.         cout << *(p+i) << " ";
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment