Hey, I'm creating a kind of database for a College project that stores values in a txt file. The thing is, it's currently set to "values.txt" and everytime the program runs, it over-writes it.
Basically what I want it to do is ask create a .txt file depending on the user_id, for example "00011.txt" etc. Here's the code:
char Customer::addCustomer()
{
ofstream file (customer_id);
if (file.is_open())
{
myfile << "Customer Name: " << customer_name << endl;
myfile << "Customer ID: " << customer_id << endl;
myfile << "Customer Address " << customer_address << endl;
file.close();
return true;
}else{
return false;
}
}
Thanks for any help :) x