1 #include <stdarg.h> 2 3 void vfoo(const char * fmt,va_list * nonsense)4vfoo(const char *fmt, va_list *nonsense) { 5 char *p; 6 7 while (*fmt) { 8 if (*fmt == '%') { 9 ++fmt; 10 puts(va_arg(*nonsense, char *)); 11 } 12 ++fmt; 13 } 14 } 15 16 void foo(const char * fmt,...)17foo(const char *fmt, ...) { 18 va_list va; 19 va_start(va, fmt); 20 vfoo(fmt, &va); 21 } 22 23 int main()24main() { 25 foo("%s%s", "hello world", "nonsnese sux"); 26 } 27 28