error with std::ostringsteam and std::string
<p>Hi i want to save many different csv files from a function with a naming convention based on a  different double value. I do this with a for loop and pass a string value to save each .csv file differently. Below is an example of what I'm trying to do the desired result would be </p>

<pre><code>1.1_file.csv
1.2_file.csv
</code></pre>

<p>but instead i get </p>

<pre><code>1.1_file.csv
1.11.2_file.csv
</code></pre>

<p>Here is a working sample code, what can i do to fix this</p>

<pre><code>#include &lt;sstream&gt;
#include &lt;iomanip&gt;
#include &lt;cmath&gt;
#include &lt;iostream&gt;
#include &lt;vector&gt;

int main(){
    std::string file = "_file.csv";
    std::string s;
    std::ostringstream os;
    double x;

    for(int i = 0; i &lt; 10; i++){
        x = 0.1 + 0.1 *i;
        os &lt;&lt; std::fixed &lt;&lt; std::setprecision(1);
        os &lt;&lt; x;
        s = os.str();
        std::cout&lt;&lt;s+file&lt;&lt;std::endl;
        s.clear();
    }

    return 0;
}
</code></pre>
