What is a constant expression

Conor P. Cahill cpcahil at virtech.uucp
Tue Oct 24 09:40:38 AEST 1989


In article <10983 at riks.csl.sony.co.jp>, diamond at csl.sony.co.jp (Norman Diamond) writes:
> In article <727 at lakart.UUCP> dg at lakart.UUCP (David Goodenough) writes:
> >#define	prequote(x) 'x
> >#define postquote(x) x'
> 
> I do not believe that this can possibly work in ANSI C.  Consider the
> following tweaks:
> 
> #define prequote(x)  'x /* is this a comment? */
> #define postquote(x) x' /* is this a comment? */

But he (dave) didn't put any comments to the right of his example, so as long
as there isn't any extra white space to the right of the code, it 
*should* work (on both pre and post ANSI).

Dave gave a good (although yukie) solution to the problem.  He didn't claim
that you could do anything with his solution and have it still work.




-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.std.c mailing list