Does it also apply when using cin to give astring a value?
Because your right when I use it to plainly display the string when the value is already given.
But when I use it like this:
That's because cin stops reading at the " ", so the first "Test" is all that ever makes it into the string in the first place. Instead of cin, use getline:
SteakRider
That does not do what was asked for! AND it's a macro
1 2 3 4 5
TO_PUT_IT_BLUNTLY: Macros are the bluntest instrument of C and C++'s abstraction
facilities, ravenous wolves in functions' clothing, hars to tame, marching to their
own beat all over your scopes. Aviod them.
Item 16 C++ Coding Standards
Herb Sutter, Andrei Alexandrescu