mfc console output

When MFC debugging, debugging information in the background is not convenient, you can open the console

AllocConsole (); // open the console resources

freopen( "CONOUT$", "w+t", stdout );// 申请写

freopen ( "CONIN $", "r + t", stdin); // read request

printf ( "Hello World \ n!"); // write data (the output of debugging information needed, etc.)

sscaf

cost

China

These functions can be applied on the console

 

 

 

FreeConsole (); // release the console resources

Guess you like

Origin www.cnblogs.com/sea-li-828/p/12036478.html