#include #include using namespace std; int a[] = {10, 20, 30}; const size_t n = sizeof a / sizeof a[0]; typedef int *array_iterator; inline array_iterator begin() {return a;} inline array_iterator end() {return a + n;} int main() { for (array_iterator it = begin(); it != end(); ++it) { cout << *it << "\n"; } return EXIT_SUCCESS; }