I\'m using MinGW to build my application on Windows. When compiling and linking, the option \"-mwindows\" is put in command line to have Win32 API functions.
To be more
I found the answer. As taken from Using STDIN with an AllocConsole()
AllocConsole(); freopen("CONIN$", "r",stdin); freopen("CONOUT$","w",stdout); freopen("CONOUT$","w",stderr);
It works like magic!
Reference for 'freopen': http://www.cplusplus.com/reference/clibrary/cstdio/freopen/