View Single Post
Join Date: Jan 2008
Posts: 3,844
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 503
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: sorting characters in a string... help!!!!

 
0
  #10
Jan 1st, 2009
Originally Posted by scias23 View Post
help here again... if i enter AaBbCc the output should be CcBbAa or cCbBaA.. but the output appears cbaCBA.. help!!! heres the code..

if(a[b]<a[c])
If that's the goal, then this line won't work for your purposes. Any lower case letter has a higher ASCII value than an upper case letter. The < operator uses the ASCII table. You need to use toupper or tolower in the line above to convert the digits from upper to lower case or vice versa and handle the comparison.

http://www.cplusplus.com/reference/c...e/toupper.html
http://www.cplusplus.com/reference/c...e/tolower.html
Reply With Quote