comment style

Larry Hastings funkstr at ucscb.UCSC.EDU
Mon Jan 7 22:51:11 AEST 1991


+-In article <1991Jan05.194321.12428 at kithrup.COM>,
| sef at kithrup.COM (Sean Eric Fagan) wrote:
|
| I know of only one C compiler that accepts //-style comments:  Microsoft C,
| versions 5.0 and later.
+----------

Well, that's certainly not all of them; Turbo C++ (and perhaps Turbo C 2.0)
for DOS accepts // comments, as do all the MetaWare compilers since version
1.5 (which is about two years).

As for /* */ style comments, I'd just use /*/ for both ends if I could
get away with it.  This makes it possible to have a single keymacro that emits
both the begin and end comment markers.  Comments would now look like:

	printf("\n");  /*/ I'm commenting this line for no reason /*/

This works quite well with all the compilers I have handy.  The only reason I
don't do this is because I'm afraid my coworkers would form a lynch mob.
--
larry hastings, the galactic funkster, funkstr at ucscb.ucsc.edu

I don't speak for Knowledge Dynamics or UC Santa Cruz, nor do they speak for me

"People, it's Fonzie with Teret's syndrome!"--Dennis Miller on Andrew Dice Clay
p.s. I'm kidding about the /*/ comment markers, in case you can't tell -- but
     I may work them in to an obfuscated C code contest entry



More information about the Comp.std.c mailing list