0

This is how I traverse an array from first to last element:

#include <iostream>
using namespace std;

int main()
{
    int a[4]={0,1,2,3}, i=0;
    for (auto i : a)
        cout << i << " ";
    cout << endl;
    return 0;
}

Is is possible to traverse it backwards using the same loop? If so, how?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Jake Wright
  • 373
  • 1
  • 8

0 Answers0