I've run into an issue with writing to a file and it being over written every time the program is ran. I can't seem to find a solution for the in.txt to stop wiping itself, so I decided to do something even better but more complicated.
Question: What can I look into to create a file for each entry from a person. I could retrieve the first and surname to name the file I guess.
I have a struct like this -
struct ClientInfo {
string first_name;
string middle_name;
string surname_name;
string date_birth;
string telephonenumber;
string first_line;
string second_line;
string zip_post; // zip code or postcode
string Country;
};
When I start the program it records it into ofstream file_in("in.txt")
successfully but then it's automatically erased at the start of next entry.