I'm using the following snippet to write values to a .txt file:
fstream f1;
f1.open("output.txt", ios::out);
{
for (const auto& avg : clusAvg)
{
f1 << avg << ",";
}
}
f1.close();
This generates a list that looks like: 20,30,40,50,
My question is, how can I eliminate that last comma in the list?