+3

A little question

How to flip over the value in string E.g String a = "Hello" //some code Output olleh

2/26/2020 3:10:09 PM

Ramanda

3 Answers

New Answer

+4

You can use string reverse iterator to generate a reversed version, as follows: std::string str {"Hello World"}; std::string reversed {str.crbegin(), str.crend()}; std::cout << reversed;

+5

Loop over the string from back to front printing each char.

+4