#include #include using namespace std; int main() { int a[] {0, 10, 20, 30, 40, 50, 60, 70, 80, 90}; const size_t n {size(a)}; //the number of elements in the array a for (int i {0}; i < n; ++i) { cout << a[i] << "\n"; //does a hidden multiplication & addition } cout << "\n"; //Skip a line. for (int *p {a}; p < a + n; ++p) { //a means &a[0]; a+n means &a[n] cout << *p << "\n"; //does no hidden multiplication & addition } cout << "\n"; //Skip a line. /* Another notation for the above loop. begin(a) is another way of saying a. Therefore it is a pointer to an int. ("it" stands for "iterator".) end(a) is another way of saying a+n. */ for (auto it {begin(a)}; it < end(a); ++it) { cout << *it << "\n"; } return EXIT_SUCCESS; }