Archived

This topic is now archived and is closed to further replies.

slightlywhacked

getting special characters

Recommended Posts

Im doing a text program for dos in c++ (and no, i dont like programming in dos, i just have to for a school project) and i need to print " to the screen.. ? how can i do this when " means stop printing stuff here like cout >> " he said "moo""; it just dosnt work, it will cause an error how can i get around this??

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
hey all you have to do is use the escape sequence, which is just putting a backslash before the quotes (\)
try:
cout >> " he said \"moo\"";
and it will work

Share this post


Link to post
Share on other sites