How do you output \ symbol using cout?
+15
A:
The '\' character is an escape character in C and C++. You can output a literal '\' by escaping it with itself:
cout << "This is a backslash: \\";
mch
2009-10-30 16:46:14
+12
A:
In addition to all the correct answers, see this for further escaped characters
\a Bell (beep)
\b Backspace
\f Formfeed
\n Newline
\r Return
\t Tab
\\ Backslash
\' Single quote
\" Double quote
\xdd Hexadecimal representation
\ddd Octal representation
\? Question mark ('?')
Tom
2009-10-30 16:49:58
There's also correct answers _below_ yours. `:)`
sbi
2009-10-30 19:17:14
You missed a few. Also what happens with '\m' (ie a non special character).
Martin York
2009-10-30 19:19:25
@Sbi: Right :) 15
Tom
2009-10-30 21:14:46