fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int arr[5] = {10, 20, 30, 40, 50};
  6.  
  7. cout << "Using pointer notation:\n";
  8. for (int x = 0; x < 5; x++)
  9. cout << *(arr + x) << endl; // access using *
  10.  
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0.01s 5324KB
stdin
Standard input is empty
stdout
Using pointer notation:
10
20
30
40
50