RE: [Dev-C++] Dev-C++ Bug? Using backslash within comments
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Reid T. <Rei...@at...> - 2005-07-06 14:36:34
|
Jonathan Dearborn wrote: > Here's an example program, though if you'd like to see the > compiled program > I found it on, check out > http://www.maybe-phil.net/websites/no-skill/jnrdev/en/jnrdev3/ >=20 > That program is based on SDL, so if you're not into that, > just use this one: > ----------------- >=20 > #include <stdio.h> > #include <iostream> >=20 > int main(int argc, char *argv[]) > { > int y; > int x =3D 200; > // let's cause a problem with backslash \ > y =3D x*55; > printf("%d\n",y); > system("PAUSE"); >=20 > printf("\n"); >=20 > // now without it > y =3D x*55; > printf("%d\n",y); > system("PAUSE"); > return 0; >=20 > // shouldn't the compiler ignore everything after these C++ style > comments? } >=20 >=20 > ------------------ > That about shows it. I know it's a little bother and I'm not > surprised it hasn't come up before, but I just wanted to help in case > someone else gets > stuck. Of course, it's only a problem with the C++ style comments. well, you just escaped the line ending character, basically telling the compiler suite that the comment line has not ended. The compiler will end the comment when it sees a valid line end. reid |