When you create a C++ console application under Windows you automatically get the console window created for you and std::cout outputs to the console window.
I have a GUI application for which I also want to create a console window. I can create the console window using the AllocConsole() function, but how do I redirect / attach std::cout to the console so that the output appears in the console window?