void TestPrint(char* format, ...)
{
va_list argList;
va_start(argList, format);
printf(format, argList);
va_end(argList);
}
int main()
{
TestPrint("Test print %s %d\n", "string", 55);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我需要得到:
Test print string 55
Run Code Online (Sandbox Code Playgroud)
实际上,我得到了垃圾输出.这段代码有什么问题?