line comments (## vs. //)

John Mackin john at physiol.OZ
Fri Nov 30 12:09:56 AEST 1984


Referrring to:

#define	// /*

<phil at Rice.arpa> writes:

> Now you
> should see why the #define won't work.  Where will you get the */ from?

But there are even better reasons: the "/*" will be taken by the
cpp to mean "start a comment here"!  In other words, all code
following will be commented out, up to the next "*/" if there is one.
"//" would be defined as a space, IF it was possible to define
it at all.  K&R, section 12.1: "A control line of the form
	#define identifier token-string
... "
Now, // sure isn't an identifier.  (Our cpp calls it an "illegal
macro name".)

John Mackin, Physiology Department, University of Sydney, Sydney, Australia
...!decvax!mulga!physiol.su.oz!john



More information about the Comp.lang.c mailing list