Writing to file - void issue
<p>I have a void type function displaying a couple of integers to the console. I want these integers to be written to a file. This is the function I'm talking about:</p>

<pre><code>void inorder(node *root)
{
    if(root)
    {
        inorder(root-&gt;left);
        std::cout &lt;&lt; root-&gt;key &lt;&lt; " ";
        inorder(root-&gt;right);
    }
}
</code></pre>

<p>I'm aware of the fact that it could have been done if I'd return array of integers. But it would complicate my code, I would have to add some kind of a count argument etc.</p>

<p>Is this possible to write the outcome of this function to a file?</p>
