va_list: This type is used as a parameter for the macros defined incstdarg to retrieve the additional arguments of a function.
Each compiler may implement this type in its own way. It is only intended to be used as the type for the object used as first argument for theva_start, va_arg and va_end macros.
va_start is in charge of initializing an object of this type, so that subsequent calls tova_arg with it retrieve the additional arguments passed to the function.
Before a function that has initialized a va_list object with va_start returns, theva_end shall be executed.
example:
|
本文详细解释了va_list在C语言宏定义中用于获取函数额外参数的方法,通过实例展示了如何使用va_start、va_arg和va_end来实现参数传递。

被折叠的 条评论
为什么被折叠?



