18

Does your editor/ide highlight that a++; in this C/C++ code as part of a comment?

int a=1;
//some comment \
a++;
printf("%d\n",a);

And what about this?

int a=1;
//some comment ??/
a++;
printf("%d\n",a);
4

10 に答える 10

2

VC6, Visual Studio 2003, 2005, 2008, 2010 all do.

于 2010-03-05T03:12:41.283 に答える
2

Slickedit - yes

KDevelop - yes

QT Creator - No

CodeBlocks - No

于 2010-03-05T03:17:08.247 に答える
2

vim 7.2 sees it as a comment, and gcc 3.4.3 compiles it as a comment.

于 2010-03-05T03:21:59.377 に答える
1

Yes, TextMate does it.

于 2010-03-05T02:58:49.017 に答える
1

Kate (3.4) only highlights the first test, fails hilighting the second test

// hello folks \
int a = 0;

// hello folks ??/
int a = 0;
于 2010-03-05T03:14:00.733 に答える
1

emacs 22.3.1: No to both, sadly

于 2010-03-05T03:51:20.613 に答える
0

From http://forums.topcoder.com/?module=Thread&threadID=666932

Quick note on which popular editors show this as a comment : vim - yes emacs - no :) kate - no gedit - yes netbeans - yes kwrite - yes

于 2010-03-05T02:58:12.637 に答える
0

XCode and CodeWarrior handle it properly. (But not the trigraph, lol.)

于 2010-03-05T03:50:52.580 に答える
0

Xcode sees the first as a comment, the second not.

于 2010-03-05T03:51:40.317 に答える
0

Good question! I was going to ask a question about this until I found this one.

The Visual-DSP++ IDE from Analog Devices does not highlight either comment when writing in assembly or C. For example:

r1 = dm(pPointer1);      // Store pointer to r0\
r0 = lshift r1 by -16;   // Not highlighted as a comment but DOES NOT EXECUTE.
dm(i0,m1) = r0;
dm(i0,m1) = r1;
于 2010-09-21T15:50:00.987 に答える