Reputation: 3326
At the command prompt I might compile my program and then run as follows:
myprogram > output.txt
Is there a similar way of redirecting the output stream in VS2010? I want to debug/run my program within the IDE but have cout stream to a file.
Upvotes: 1
Views: 350
Reputation: 9260
Just redirect the stdout stream pointer.
freopen( "file.txt", "w", stdout );
Upvotes: 7