/ / Open the console in the Windows program #include #include #include
Bool createconsole (void) {freeconsole (); if (allocconsole ()) {int hCRT = _open_OSFHANDE ((long) getstdhandle (std_output_handle), _o_text); * stdout = * (:: _ fdopen (HCRT, "W")); :: setvbuf (stdout, null, _ionbf, 0); * stderr = * (:: :: setvbuf (stderr, null, _ionbf, 0); return true;} return false; } Call this function when the program starts