Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!stl!stc!datlog!scm From: scm@datlog.co.uk ( Steve Mawer ) Newsgroups: comp.lang.c Subject: Re: Something new in C syntax Summary: Something new, something old Keywords: ifdefs comments Message-ID: <1734@dlvax2.datlog.co.uk> Date: 3 Feb 89 08:28:33 GMT References: <4586@bunker.UUCP> Reply-To: scm@datlog.co.uk ( Steve Mawer ) Organization: Data Logic Ltd, Queens House, Greenhill Way, Harrow, London. Lines: 39 In article <4586@bunker.UUCP> allen@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 or < {backbone}!ukc!datlog!scm > Voice: +44 1 863 0383 (x2153)