Wow, good catch on the tutorial example.
Beginner post about something similar:
http://www.cplusplus.com/forum/beginner/122539/#msg667824
A possible alternate solution would be:
http://pastie.org/8689954#12,14,18
Getline() References:
std::string getline(): http://www.cplusplus.com/reference/string/string/getline/
istream getline(): http://www.cplusplus.com/reference/istream/istream/getline/
Have fun.
[Edit]:
I feel that "cin" is acceptable for acquiring primitive data, however it's drawback is possibly safety.
Things to consider when working with "cin":
(whitespaces, tabs, new-line...) |