Hello everyone...i need help with text file in c++,i know that we can append like ios::app and into a text file.....i need help in inserting a particular string to a particular line in a text file.....is that possible....So far i only knw tht it will append at the bottom of the text file
this is the code i did for the appending part......
ofstream enter_names("names.txt", ios::app);
ofstream enter_id("id.txt", ios::app);
cout<<"Enter Name:";
getline(cin,member_name);
cout<<"Enter Id:";
getline(cin,card_id);
enter_names<<member_name<<endl;
enter_id<<card_id<<endl;//lets say i want to store card id in line 5 of the text file.