有时用MFC 写的程序,为了调试的方便 , 需要用到控件台窗口的时候.. 可以如下做法
AllocConsole();
freopen( "CONOUT$", "w+t", stdout );// 申请写
freopen( "CONIN$", "r+t", stdin );
printf("Hello World!n");
char ch = getchar();
FreeConsole();
有时用MFC 写的程序,为了调试的方便 , 需要用到控件台窗口的时候.. 可以如下做法
AllocConsole();
freopen( "CONOUT$", "w+t", stdout );// 申请写
freopen( "CONIN$", "r+t", stdin );
printf("Hello World!n");
char ch = getchar();
FreeConsole();