Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否有一种方法可以在不使用 va_arg 函数的情况下迭代变量参数 lisf。如果是这样,有人可以给我一个例子吗?
不,va_arg这是标准 C 提供的唯一机制,用于迭代可变参数。
va_arg
在特定实现上可能还有其他方法(例如,根据 ABI 定义其布局的方式检查堆栈内存),但它们将是不可移植的,并且几乎没有任何充分的理由使用除va_arg.