How do I print double quotes?

Jun 10, 2008 at 5:48pm
Quick question on use of "ofstream." I'm trying to use ofstream to output some text to a file. The problem is that the text I want to output contains double quotes (the " character), but C++ syntax requires me to enclose the text in double quotes. Is there any way around this?

Thanks.
Jun 10, 2008 at 6:07pm
Use an escape sequence:

cout << "Say \"hello\" to the nice people!\n";

:-)
Jun 10, 2008 at 6:15pm
Thanks!
Topic archived. No new replies allowed.