1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
void Test() {
ifstream file;
string reg,name,gender,clas,age,add,fees,marks;
int intage,fee,mark;
file.open("data+updated.csv", ios::app);
if (!file) {
cout << "File Doesn't Exist\n";
}
while (!file.eof()) {
getline(file, reg, ',');
getline(file, name, ',');
getline(file, gender, ',');
getline(file, clas, ',');
getline(file, age, ',');
getline(file, add, ',');
getline(file, fees, ',');
getline(file, marks, '\0');
cout << reg << "," << name << "," << gender << "," << clas << "," << age << "," << add << "," << fees << "," << marks << endl;
intage = stoi(age);
fee = stoi(fees);
mark = stoi(marks);
}
file.close();
}
|