-
string manipulation
Hi experts,
I am fairly new to C++ but what I am trying to do is read the text one character at a time (told not to use arrays yet) then if the user enters a word where a character occurs twice in a row then I am suppose to upper case the first occurrence and remove the second. example user enters "oops" output would be "Ops."
Any help on this subject or just string manipulation itself would be a great help. thank-you
-
you could cheat (or at least do something your instructor probably hasn't told you yet).
get a character
if that character has been printed before (use a temporary varable to tell), then write a backspace character (number 8 in the ascii system) and print the uppercase of your character
else print just print the character
store the character in a temporary variable for future reference.
repeat for every character
now put this into C code. it's not hard.