void printlist(int begin,...) { va_list ap; char *p; va_start(ap, begin); p = va_arg(ap, char *); while (p != NULL) { fputs(p, stdout); putchar(' '); p = va_arg(ap, char*); } va_end(ap); } int _tmain(int argc, _TCHAR* argv[]) { printlist(0, "hello", "world", "foo", "bar", NULL); char c; std::cin >> c; }