This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: using same macro arg as both: var and "var"?
- From: Christoph Bartoschek <bartoschek at gmx dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 29 Jan 2009 23:34:51 +0100
- Subject: Re: using same macro arg as both: var and "var"?
- References: <20090129211035.GG3135@comppasch2>
Am Donnerstag 29 Januar 2009 schrieb fkater@googlemail.com:
> #define macro1(a) void func##a(){ printf(a); }
>
> Either way, of course, I get an error:
>
> macro1(x);ÂÂÂÂÂÂ Â/* error: 'x' in printf not quoted */
> macro1("x")ÂÂÂÂÂ Â/* error: func"x" not a func name */
#define macro1(a) void func##a(){ printf(#a); }
and use it:
macro1(x)
Christoph