cout warning

Hello,

i would like to ask when for example we have:

cout << "\." ;


the compiler will display a warning:

unknown escape sequence '\.' 




Why does this message appear ?

i mean i know how to solve it ( cout << "\\.") but i do not understand the reason this message appears .

Thank you.
in a character string the '\' character represents the fact that an escape character will be next to come, for example you probably know that \n means newline. '\' tells the compiler that the next character shouldn't be dealt with like an ordinary string, but taken as an escape sequence.

'\.' is not a valid escape sequence like \n and that's why you get the warning.
Topic archived. No new replies allowed.