Hi Guys im looking for a tool/application that can read this code:: Code: void create() { // file pointer fstream fout; // opens an existing csv file or creates a new file. fout.open("reportcard.csv", ios::eek:ut | ios::app); cout << "Enter the details of 5 students:" << " roll name maths phy chem bio"; << endl; int i, roll, phy, chem, math, bio; string name; // Read the input for (i = 0; i < 5; i++) { cin >> roll >> name >> math >> phy >> chem >> bio; // Insert the data to file fout << roll << ", " << name << ", " << math << ", " << phy << ", " << chem << ", " << bio << "\n"; } } Can anybody help?
There are some syntax errors with your code. Can you try the below code, It may fix the error you are getting. Code: #include <iostream> #include <fstream> using namespace std; void create() { // File pointer fstream fout; // Open an existing CSV file or create a new file. fout.open("reportcard.csv", ios::out | ios::app); cout << "Enter the details of 5 students: roll name maths phy chem bio" << endl; int i, roll, phy, chem, math, bio; string name; // Read the input for (i = 0; i < 5; i++) { cin >> roll >> name >> math >> phy >> chem >> bio; // Insert the data to the file fout << roll << ", " << name << ", " << math << ", " << phy << ", " << chem << ", " << bio << "\n"; } // Close the file fout.close(); } int main() { create(); return 0; } Thanks