I am using minGW with Eclipse Juno CDT package on Windows 7 64. I am having a compilation problem. I put in this code:
cout << "Use \\n to cause a newline; use \\t to cause a tab." << '\n'; cout << "Use \\a to cause a beep (only on some platforms)!";
or this code
printf("Use \\n to cause a newline; use \\t to cause a tab.\n"); printf("Use \\a to cause a beep (only on some platforms)!\n");
Here is the problem. The \n or \a or \t does not get compiled as the two characters \ and n or \ and t or \ and a. Instead they get compiled as \n, and \a, and \t. This is the same whether I run it in the command line or on the debugger in eclipse. When I try just \ it correctly compiles it as . It is almost like the compiler takes the \ and compiles it into a \ and then compiles the \ and the n together, for example, as a \n which is a carriage return.
Any help is much appreciated.