va_list and va_arg
问题 I using va_list like this: void foo(const char* firstArg, ...) { va_list args; va_start (args, firstArg); for (const char* arg = firstArg; arg != NULL; arg = va_arg(arg, const char*)) { // do something with arg } va_end(args); } foo("123", "234", "345") the first three arguments was passed to foo correctly, but where "345" is done, arg = va_arg(arg, const char*) set some other freak value to arg . so What's the problem. I using llvm3.0 as my compiler. 回答1: C does not automatically put a NULL