getting special characters
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??
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
try:
cout >> " he said \"moo\"";
and it will work
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement