Check out example codes for "for loop reverse C++". It will help you in understanding the concepts better.

Code Example 1

// Using iterators
for (auto it = s.crbegin() ; it != s.crend(); ++it) {
  std::cout << *it;
}

// Naive
for (int i = s.size() - 1; i >= 0; i--) {
  std::cout << s[i];
}

Learn ReactJs, React Native from akashmittal.com