std::string mit std::reverse umkehren (C++)
English
Deutsch
reverse_string_cpp.cpp
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(int argc, char** argv) {
std::string s = "My string";
// Dies kehrt s in-place um.
std::reverse(std::begin(s), std::end(s));
// Gibt "gnirts yM" aus
cout << s << endl;
}Check out similar posts by category:
C/C++
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow