Q-> can you nest comments in var names?

Karl Heuer karl at haddock.ima.isc.com
Thu Oct 11 11:05:34 AEST 1990


In article <1990Oct10.211829.3168 at eng.umd.edu> rfink at eng.umd.edu (Russell A. Fink) writes:
>By rules of Kernighan and Ritchie, or standard adaptations of the
>language, can I nest comments within variable names?
>	printf ("Value is %d", num/* this is obnoxious */ber);

It's illegal (because comments are whitespace) in ANSI C.  In Classic C it's
illegal according to the book, but legal by common practice, so the practical
answer is that it's implementation-dependent.

Karl W. Z. Heuer (karl at ima.isc.com or harvard!ima!karl), The Walking Lint



More information about the Comp.lang.c mailing list