I have a requirement, I need to use printf and cout to display the data into console and file as well. For printf I have
printf
cout
console and file
There's already a Boost class for this: tee