What's new

How to write quotes in C++ ?

R

rico001

Guest
cout >> " "Hello" ";

how do I write something like ("Hello") with quotes in C++?

Thanks in advance.
 

Cyberman

Moderator
Moderator
I'm just a bit confused... should it not be

Code:
cout << "\"Hello!\"";
where << is the stream output operator?
>> as far as I know would cause your program to halt with an exception..
because firstly you are trying to first write to a string constant and secondly cout is an output only stream and you are trying to perform an input operation.

In fact I don't even believe it will compile that way :)

>> == stream input operator
<< == stream output operator

Cyb
 
Last edited:

Dominator

Moderator
aprentice said:
printf("\"Hello!\"\n");

is much better =p

if(!safeass) {printf("\"Take this workaround at 08%X in your face"\n");}
else{"\"You could still take it in your Xss"\n;}"

is closer to some reality :(
 

Top