The error reads:
request for member \'begin\', \'end\' in \'arr\' which is non class type int[5], unable to deduce from expression error.
In C++, arrays are not classes and therefore do not have any member methods. They do behave like pointers in some contexts. You can take advantage of this by modifying your code:
#include
using namespace std;
int main()
{
int * mypointer;
const int SIZE = 5;
int arr[SIZE] = {1,3,5,7,9};
mypointer = arr;
for(auto it = arr; it != arr + SIZE; ++it) {
cout<<*mypointer<
Of course, this means that mypointer
and it
both contain the same address, so you don't need both of them.