WindowsGUI程序在控制台输入输出
// 程序的开始处
// The AllocConsole function allocates a new console for the calling process.(msdn)
AllocConsole();
// 将stdin与stdout重定向 freopen("CONOUT$","w+t",stdout); freopen("CONIN$","r+t",stdin);
// 程序的结束处
// The FreeConsole function detaches the calling process from its console.(msdn) FreeConsole();
浙公网安备 33010602011771号