void va_start(va_list ap, last); //变参起始地址
type va_arg(va_list ap, type); //下一个参数的地址
void va_end(va_list ap);
void va_copy(va_list dest, va_list src);
int vprintf(const char *format, va_list ap); //打印字符串
int vfprintf(FILE *stream, const char *format, va_list ap);
int vsprintf(char *str, const char *format, va_list ap);
int vsnprintf(char *str, size_t size, const char *format, va_list ap);
举例
#include <stdio.h>
#include <stdarg.h>void func(const char *format, ...)
{va_list ap;char *str;va_start(ap, format);vprintf(format, ap);while(...){str = va_arg(ap, char*);printf("str = %s\n", str);}va_end(ap);return;
}int main()
{func("hello %s %s", "furong", "quange");return 0;
}