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

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

 



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


[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