Redirect std::cout to a file

Redirect std::cout to a file, or t-split it so that the output goes both to the console and a file:

Redirect cout to file

Simpler way to redirect–just assign a file output stream to std::cout (I didn’t check if it works, though):

Redirect cout to file

Advertisements
Redirect std::cout to a file

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s