Anonymous user
Reverse a string: Difference between revisions
→{{header|C++}}: std::get_line fails in gcc4 on Solaris 10, "error: 'get_line' is not a member of 'std'" : std::getline works
(→{{header|C++}}: std::get_line fails in gcc4 on Solaris 10, "error: 'get_line' is not a member of 'std'" : std::getline works) |
|||
Line 167:
=={{header|C++}}==
<lang cpp>#include <iostream>
#include <string>
Line 174 ⟶ 176:
{
std::string s;
std::
std::reverse(s.begin(), s.end()); // modifies s
std::cout << s << std::endl;
|