Handy tip from one of the MS bloggers:
Snippets - redirecting stdin,stdout,stderr to a file
If you have a Windows app, and the code you are working with does a lot of printf() debugging, then you can’t see the output because there’s no console window. Using this tip could be quite useful for this.