在 C 函数声明中,“..."是什么意思?作为最后一个参数做什么?
问题描述:
我经常看到这样声明的函数:
Often I see a function declared like this:
void Feeder(char *buff, ...)
..."是什么意思?
答
它允许可变数量的未指定类型的参数(就像 printf
那样).
it allows a variable number of arguments of unspecified type (like printf
does).
您必须使用 va_start
、va_arg
和 va_end
见http://publications.gbdirect.co.uk/c_book/chapter9/stdarg.html 了解更多信息