comment style

Leif Andrew Rump andrew at resam.dk
Sat Jan 12 02:53:26 AEST 1991


In <10852 at darkstar.ucsc.edu> funkstr at ucscb.UCSC.EDU (Larry Hastings) writes:
>+-In article <4423 at alliant.Alliant.COM>,
>| tj at Alliant.COM (Tom Jaskiewicz) wrote:
>|
>| My first impression of // comments was that they are a harmless addition
>| to the language.  After reading some of the discussion in this newgroup
>| I now believe that they are not harmless.
>| 
>| If you do add // comments to c, what does the following code do?
>| 
>| /*	printf("One\n");	/* 1 */
>| 	printf("Two\n");	/* 2 */
>| /*	printf("Three\n");
>| //	printf("Four\n");	/* 4 */
>| 	printf("Five\n");	/* 5 */
>| //	printf("Six\n");	/* 6
>| 	printf("Seven\n");	/* 7 */
>| /*	printf("Eight\n");
>| // */	printf("Nine\n");
>| 	printf("Ten\n");	/* 10 */
>+----------

>Well, under Turbo C (which supports // comments in "Turbo C" and "Turbo C++"
>modes"), this prints
>Two
>Five
>Seven
>Nine
>Ten

Just a single question: Does TC warn you about comment (/*) inside
a comment (//)? If not then _I_ will never mix // and /**/ and maybe
even abandon // completely!!!

Leif Andrew



Leif Andrew Rump, AmbraSoft A/S, Stroedamvej 50, DK-2100 Copenhagen OE, Denmark
UUCP: andrew at ambra.dk, phone: +45 39 27 11 77                /
Currently at Scandinavian Airline Systems                =======/
UUCP: andrew at resam.dk, phone: +45 32 32 51 54                \
SAS, RESAM Project Office, CPHML-V, P.O.BOX 150, DK-2770 Kastrup, Denmark

> > Read oe as: o <backspace> / (slash) and OE as O <backspace> / (slash) < <



More information about the Comp.std.c mailing list