|
From: <or...@vp...> - 2002-11-19 21:15:52
|
Hi problem hunters! Tuesday, November 19, 2002, 7:37:32 PM, Brenden wrote: BT> Newlines are illegal in string constants, according to K&R. It's a bug, BT> you should reported to the DevCpp folks. Well, first of all the compiler has nothing to do with the DevCpp developers. The compiler that DevCpp uses, is the Minimalist GNU for Windows (MinGW). It uses the GNU Compiler Collection (gcc) for compiling. Take a look at http://www.mingw.org for details. >>main () >>{ >> printf("hello, world >> \n >> >> >> "); >> system("PAUSE"); >>} The reason why this works, is this: " Using the GNU Compiler Collection: String Literals with Embedded Newlines As an extension, GNU CPP permits string literals to cross multiple lines without escaping the embedded newlines. Each embedded newline is replaced with a single `\n' character in the resulting string literal, regardless of what form the newline took originally. CPP currently allows such strings in directives as well (other than the `#include' family). This is deprecated and will eventually be removed. " As you could read, it is DEPRECATED. GCC 3.2 (what I have installed) gives the following warning for the program (older ones don't): warning: multi-line string literals are deprecated Look at: http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/ and search for "String Literals with Embedded Newlines". -- Best regards, Oroszi Balázs mailto:or...@vp... PGP-FP: FB80 8A43 2664 6126 E465 46E2 2546 CFA3 C25B 9F70 finger -l or...@se... |