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();

 

posted @ 2013-08-19 21:06  wotent  阅读(373)  评论(0)    收藏  举报