Advertisement
Guest User

How to call a value on pointer #CHUPETINVASACAER

a guest
May 27th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include<iostream>
  2. #include<ctime>
  3. #include<cstdlib>
  4. using std::cout;
  5. using std::endl;
  6. using std::cin;
  7. void main() {
  8.     int n = 5;
  9.     int *arr = new int[n];
  10.     for (int i = 0; i < n; i++)
  11.     {
  12.         arr[i] = rand() % 10;
  13.     }
  14.     for (int i = 0; i < n; i++)
  15.     {
  16.         cout << arr[i] << " ";
  17.     }
  18.     cout << endl;
  19.     cout << arr[4] << *(arr + 4) << 4[arr] << endl;
  20.     cin.ignore(), cin.get();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement