Я пытаюсь вывести некоторые данные в CSV файл, и он выводит его в файл, но он не разделяет данные на разные столбцы и, кажется, выводит данные некорректно.
ofstream Morison_File ("linear_wave_loading.csv"); //Opening file to print info to
Morison_File << "Time Force(N/m)" << endl; //Headings for file
for (t = 0; t <= 20; t++) {
u = sin(omega * t);
du = cos(omega * t);
F = (0.5 * rho * C_d * D * u * fabs(u)) + rho * Area * C_m * du;
cout << "t = " << t << "\t\tF = " << F << endl;
Morison_File << t; //Printing to file
Morison_File << F;
}
Morison_File.close();
Время и сила (Н/м) находятся в столбцах A и B соответственно, но значения t и F печатают первую строку.
Каков синтаксис для их разделения для печати t в столбцы A и F в столбец B?