ofstream outputFile ("output.txt");
if (outputFile.is_open())
{
outputFile << "GLfloat vector[]={" << copy(vector.begin(), vector.end(), ostream_iterator<float>(cout, ", ")); << "}" << endl;
}
else cout << "Unable to open output file";
如何将向量输出到文件,每个浮点数用逗号分隔?如果可能的话,我还想避免打印方括号。