News for hackers. Stuff that matters.
Re:The One Character Block Comment by dfranke on Tuesday July 21, 2009 @04:00PM (#716772)
This is also an old trick to test whether your code was compiled as a C++ or not:

  2//**/2
    == 1) ? "C" : "C++"
Re:The One Character Block Comment by yason on Wednesday July 22, 2009 @03:20AM (#717530)
This is fun and has some hack value but I hope nobody ever uses such a kludge in real code.

It totally fails with crappy C compilers that decide to feature C++ comments unannounced. IIRC gcc does this unless you give -ansi or -std=c89. And C99 officially supports the // -comments but hasn't got C++ features, of course.

Re:The One Character Block Comment by timf on Tuesday July 21, 2009 @08:46PM (#717147)
Is there a situation where you would need this instead of "#ifdef __cplusplus"?

e.g. http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#...

Re:The One Character Block Comment by dfranke on Tuesday July 21, 2009 @08:58PM (#717159)
No. It's just for hack value.