Answers for "for loop reverse C++"

C++
2

for loop reverse C++

// 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];
}
Posted by: Guest on October-04-2020
0

string reverse iterator c++

...evil pets won
Posted by: Guest on November-02-2020

Browse Popular Code Answers by Language