I want help in reversing a string without using another array.
a string "Hello" should be printed as "olleh"
Please help.
sunveer
0
Newbie Poster
Recommended Answers
Jump to PostSince you didn't give nearly enough information, or provide even a rudimentary attempt, this is all you get. Here's how a real-world programmer would do it:
#include <algorithm> #include <string> std::string s = "hello"; std::reverse ( s.begin(), s.end() );
Jump to Post>i don't know algorithms and functions
Yes, I figured as much.>Please provide the simplest code .
It doesn't work that way. You prove that you've made an honest attempt, then we provide help to boost you along.
Jump to Posti think first of all you really need to attempt it by yourself. People here will help you only if you have made some honest attempt :)
All 10 Replies
Narue
5,707
Bad Cop
Team Colleague
sunveer
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
Sky Diploma
571
Practically a Posting Shark
Salem
5,138
Posting Sage
bhoot_jb
47
Junior Poster in Training
Salem
commented:
Well said
+22
STUDENT#101
-2
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
STUDENT#101
-2
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
Dave Sinkula
commented:
:)
+17
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.