1#include <iostream>
2#include <array>
3using namespace std;
4
5int main () {
6 const int size = 5;
7 array<int, size> numbers; // create stl array template
8 array<int, size> :: iterator NUMBER_ITERATOR; // declare iterator that points to stl template numbahs
9
10 NUMBER_ITERATOR = numbers.begin(); // points iterator to first element in array template
11 cout << "Please fill the array: \n";
12 for(;NUMBER_ITERATOR != numbers.end(); NUMBER_ITERATOR++) cin >> *NUMBER_ITERATOR; // enter the value for each element one-by-one
13
14 NUMBER_ITERATOR = numbers.begin(); // reset the pointer to first element
15 cout << "Displaying array: \n";
16 for(;NUMBER_ITERATOR != numbers.end(); NUMBER_ITERATOR++) cout << *NUMBER_ITERATOR << "\n"; // prints out value for each
17 cout << endl;
18
19 return 0;
20}