c++ - ofstream is writing date and time only -
i trying write text file after code executes can see time , date written in file rather actual data need written file. what strange when run program can see data stored in memory until close windows console not storing data file. i have code uses ifstream , has close @ end not sure if might keeping file open. when writing file program writes @ last position of cursor rather end of file. here code write file. void createperson (person persons[], int* count) { char fullname[100]; char personaddress[200]; int marks1; int marks2; int marks3; int marks4; int marks5; int personnumber; string persongender; ofstream outfile("testfile.txt", std::ios_base::app); if(outfile.fail()){ cerr << "file cannot opened" << endl; } cout<<"enter person's number: "<<endl; cin>>personnumber; cout <<"enter person's full name: "<<endl; cin.ignore(); ...