#include <iostream>
using namespace std;
int main(void) {
int *ptr; //pointer to an integer
int ar[7]; //array of 7 integers
ptr = ar; //point to the first element of the array
//populate the array
for(ptr=ar; ptr < ar+7; ptr++) {
*ptr = ptr - ar + 1;
}
//print out the array
for(ptr=ar; ptr < ar+7; ptr++) {
cout << *ptr << endl;
}
return 0;
}