Reading and writing to the same file fstream
<p>I would like to update existing json file. </p>

<p>This is example json file:</p>

<pre><code>{
   "Foo": 51.32,
   "Number": 100,
   "Test": "Test1"
}
</code></pre>

<p>Logs from program:</p>

<pre><code>Operation successfully performed
100
"Test1"
51.32
46.32
Done
</code></pre>

<p>Looks like everythink works as expected...</p>

<p>If I change fstream to ifstream to read and later ofstream to write it's working...</p>

<p>I tried use debugger and as I see I have wrong data in basic_ostream object... but I dont know why, I use data from string with corrected (updated data).
Any idea what is wrong :-) ?</p>