New 'n' Improved comp.lang.c FAQ List
Chris Torek
torek at elf.ee.lbl.gov
Thu Apr 4 08:49:32 AEST 1991
In article <1780 at mti.mti.com> adrian at mti.UUCP (Adrian McCarthy) writes:
>I'm not sure if people are really trying to clear this up, or if they're
>just trying to propagate the joke. At the risk of being a fool...
(I think people are getting it wrong, rather than perpetuating the
Emily Postnews bit. Anyway, this sort of joke works the way Manny
described to Mike: `Use it once, you're a wit. Use it twice, you're
a half-wit.' `Geometric progression?' `Or worse.')
> #include <limits.h>
> #define QUOTE(a) #a
> static char retbuf[sizeof(QUOTE(INT_MIN))];
This almost works: it expands to
static char retbuf[sizeof("INT_MIN")];
You must use two levels of macro evaluation:
#define XQUOTE(a) QUOTE(a) /* expanded quote */
static char retbuf[sizeof(XQUOTE(INT_MIN))];
--
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427)
Berkeley, CA Domain: torek at ee.lbl.gov
More information about the Comp.lang.c
mailing list