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

fkater@googlemail.com fkater@googlemail.com
Fri Jan 30 08:53:00 GMT 2009


Cristiano Di Buduo:

> 
> > Hi all,
> >
> > I would like to define a macro with a single arg which
> > shall be used in both ways: The quoted and unquoted way:
> >
> > #define macro1(a) void func##a(){ printf(a); }
>  
>  
> It'll work the way you intend if you change it to printf(#a);

Very cool! Thank You.
I wonder where I could have looked it up myself.

Felix



More information about the Gcc-help mailing list