Something new in C syntax

Steve Mawer scm at datlog.co.uk
Fri Feb 3 18:28:33 AEST 1989


In article <4586 at bunker.UUCP> allen at bunker.UUCP (C. Allen Grabert) writes:
>                                                     I did not write the
>code, but thought, like the author, that the first "printf" should not
>have been commented out.
>
>main()
>{
>#ifdef jjj
>/*
>#endif
>	printf("hello world\n");
>#ifdef jjj
>*/
>#endif
>	printf("goodbye cruel world\n");
>}


If you've ever looked at the output from
the C compiler's preprocessor (on every
system *I've* seen, anyway) you'll find
that all comment lines are replaced with
blank lines.

(The whitespace from #included files has
to be seen to be believed :-)).

That being the case, it's the preprocessor
that handles the comments, so the lines upto,
but exluding, the last #endif, will be
blanked.  This may be confusing but it's
predictable (and expected?).




-- 
Steve C. Mawer        <scm at datlog.co.uk> or < {backbone}!ukc!datlog!scm >
                       Voice:  +44 1 863 0383 (x2153)



More information about the Comp.lang.c mailing list