How to define macro function which support no input parameter and support also input parametr in the same time

前端 未结 4 1748
不知归路
不知归路 2021-01-15 22:12

I want to define a macro function which support at the same time:

1) No input parameter

2) Input parameters

some thing like that:

#de         


        
4条回答
  •  不要未来只要你来
    2021-01-15 22:42

    gcc and recent versions of MS compilers support variadic macros - that is macros that work similar to printf.

    gcc documentation here: http://gcc.gnu.org/onlinedocs/gcc/Variadic-Macros.html

    Microsoft documentation here: http://msdn.microsoft.com/en-us/library/ms177415(v=vs.80).aspx

提交回复
热议问题