Discovered this trick for the first time. You can use
AllocConsole() to redirect ANY std stream to debug console.
In most cases people use either TRACE() statement (but you have include MFC or ATL for that) or Win API OutputDebugString().
With AllocConsole() your code may look like this:
freopen("CONOUT$", "w", stdout);
Learning something new every day. 😀