okays... so i'm looking for some kind of a standard algorithm that doesn't take long.
i thought going backwards, finding the first space, writing the last word and nulling (is that even possible?) each char, but that doesn't really sound good to me. I've seen some people say you should double reverse...i can reverse the whole string but i kinda gotta deal with multiple spaces, for example:
" this is a string "
output:
"string a is this"
help!
wellibedamned
0
Light Poster
Recommended Answers
Jump to Postokays... so i'm looking for some kind of a standard algorithm that doesn't take long.
i thought going backwards, finding the first space, writing the last word and nulling (is that even possible?) each char, but that doesn't really sound good to me. I've seen some people say you should …
Jump to PostI happened to have already made quite a few functions to help do this.
for example:GetWord(char *text, char *gaps, int bzIndex /* 0 based index */); cout << GetWord( "#[]Hello_{World::" , "#[]_{:" , 0); // Returns "Hello" cout << GetWord( "#[]Hello_{World::" , "#[]_{:" , 1); // …
All 5 Replies
VernonDozier
2,218
Posting Expert
Featured Poster
William Hemsworth
1,339
Posting Virtuoso
wellibedamned
0
Light Poster
Radical Edward
301
Posting Pro
wellibedamned
0
Light 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.