Console windows and standard streams
Sunday, September 30th, 2007Categories: Programming
Console windows can be convenient for outputting debug information, but you don’t need them all the time. With the Windows API, you can create and destroy a console window whenever you want, so this gives you the opportunity to only create a console window when your program actually has something to report. However, by default these console windows aren’t connected to the standard streams, so std::cout, std::cerr and std::cin won’t work. Fortunately, it’s not that hard to fix. I spent some time to solve this problem and I thought I’d share my solution.
» Read the rest of this post.
