跳到主要内容

numargs

描述​

用于获取函数接收的参数数量

示例​

SomeFunction(...)
{
printf("numargs(): %i", numargs());
}

public OnFilterScriptInit()
{
SomeFunction(1, 2, 3);
}

// 输出: "numargs(): 3"
// 因为传递了三个参数(1, 2, 3)

相关函数​

  • getarg: 从可变参数列表获取指定参数
  • setarg: 设置可变参数的值