Re: using same macro arg as both: var and "var"?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Donnerstag 29 Januar 2009 schrieb fkater@xxxxxxxxxxxxxx:
> #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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux