pravej
0
Newbie Poster
Recommended Answers
Jump to Post#include <string> #include <algorithm> int main(){ std::string text = "reversi mei!"; std::reverse(text.begin(), text.end()); }
Jump to PostCreate an index at both ends of the string and swap characters, moving the indices closer until they meet. When they meet (or pass), the string will be completely reversed.
All 6 Replies
pseudorandom21
166
Practically a Posting Shark
pravej
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
pravej
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
template<>
37
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.