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(‘\n‘); 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; }
时间: 2024-11-12 08:15:31