我有一个从ruby脚本调用的变量参数函数,如下所示:
static myMethod(VALUE exc, const char *fmt, ...)
{
// Implementation of myMethod which requires all the arguments
// how to access the all arguments.
}
Run Code Online (Sandbox Code Playgroud)
谁能告诉我如何访问所有参数.提前致谢.
"访问所有参数"是什么意思?您可以通过使用从宏由一个访问可变参数一个va_...组(va_start,va_arg等等),它的方式通常做.