# can somone help my mate?

This is a discussion on can somone help my mate? within the C++ Programming forums, part of the General Programming Boards category; my mate is new to C++ and he uses the dev c++ compiler, one of the best around or so ...

1. ## can somone help my mate?

my mate is new to C++ and he uses the dev c++ compiler, one of the best around or so i hear.

anyway, when he comiled his program, he got no compile errors, but a warning that said:

unknown escape sequence '\/' on line 8 which was just text
using printf and "\n\n"
he justs wants to know what its telling him

2. when you want to use a \ literally, you must escape it using another \
if you don't the compile thinks you're trying to escape the next character...
i don't know all of them by heart, but \a, \n, \b, \r, etc are all escape sequences. if the compiler come across one that it doesn't recognize, it gives you a warning....

try this
Code:
int main()
{
char x[] = "abc\def";
char y[] = "abc\\def";
cout << x << endl << y << endl;
}
i'm thinking this should print
abcef
abc\def

3. somewhere, he has "\/"... basically, what that is doing is trying to find an escape character '/', which there is none... all you have to do is find that line and type "\\/" instead... that is, of course, if he wanted to print "\/"

4. when you want to use a \ literally, you must escape it using another \
if you don't the compile thinks you're trying to escape the next character...
i don't know all of them by heart, but \a, \n, \b, \r, etc are all escape sequences. if the compiler come across one that it doesn't recognize, it gives you a warning....

try this
Code:
int main()
{
char x[] = "abc\def";
char y[] = "abc\\def";
cout << x << endl << y << endl;
}
i'm thinking this should print
abcef
abc\def