[cs13001] Strings.

Mikhail Nesterenko mikhail at cs.kent.edu
Sun Oct 7 17:42:27 EDT 2012


> I was messing around with strings in the compiler and I wrote this:
> 
> string s = "Good luck!";
> cout << s;
> 
> And it printed out "Good luck!". Didn't we take in the slides that
> only "Good" would be returned?

The above behavior is correct. What you were thinking about is
inputting strings. Try this code:

	 string s;
	 cin >> s;

Then input:

    	 Good luck!

Now see what value string "s" would be assigned.

Thanks,
-- 
Mikhail


More information about the cs13001 mailing list