So I'm almost done with all the beginner exercises in this link http://www.cplusplus.com/forum/articles/12974/ (Now is time to move on to the graduation exercise) and I just wanted to ask how would you guys solve this exercise.
task: Write a program that asks for a user first name and last name separately.
The program must then store the users full name inside a single string and out put it to the string.
i.e.
Input:
John
Smith
Output:
John Smith
★ Modify the program so that it then replaces every a, e, i , o, u w/ the letter z.
i.e.
John Smith -> Jzhn Smzth
★★ Modify the Program so that it reverses the users name
i.e.
John Smith -> htimS nhoJ
std::ws is an input manipulator which consumes whitespaces. It is useful when you are not sure if tere is whitespace characters (especially newline which tends to break getline) left by formatted input and your string should not have leading whitespaces anyway.
Actually I was lazy and did not remove trailing spaces from string after reading, which is a good idea to do.