C language

  • C language variable parameter macro

    The previous article shared the use of variable parameters in functions, but variable parameters can only be used in real functions, not in macro definitions. Therefore, the C99 compiler standard introduces macros __ VA_ Args__, which allows us to define variable parameter macros, so that we can use macros with variable parameter tables The specific form is as follows: \define debug (format,…)printf (format, \u va\args\u) Default number represents a variable parameter table. Use the reserved name __ VA_ Args__ pass the parameters to the macro. When the macro is called…

    May 30, 2022
    13