ofstream myfile("courses.txt"); myfile<<C_Semester.code<<"$" << C_Semester.name<<"$" << C_Semester.Pre_req<<"$" << C_Semester.time<<"$" << C_Semester.fee<<"$"; if(C_Semester.isUnderGraduate==true) myfile<<"UnderGraduate$!\n"; else myfile<<"Graduate$!\n"; for(int k=0;k<i;i++) myfile<<temp_store[k]; //this overwrites the previous data..Main Problem! myfile.close(); delete[] temp_store;
Why the curose position in the file afer if-else condition of graduate or undergraduate move to beginning and then overwrites the data??
ofstream myfile("courses.txt", ios::app);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)