I am reading in from a text file and storing the data into different string variables which are in my struct. Currently I use an asterisk to separate the info in the text file, and have a garbage string variable that I pass the asterisk into in my struct. I would like to be able to get rid of that and just omit any asterisk. Can you guys help me figure out how this would be done? Thanks
void store::load()
{//////////////////////////////////load movies into template
LOAD.open("movies.txt", /*ios::app |*/ ios::beg);
if(!LOAD.is_open())
{
cout << "Could not open movies.txt";
cin.ignore();
cin.get();
exit(1);
}
movieList.clear(); //emptying my stl list object.
while(!LOAD.eof())
{
movie *mov = new movie;
getline(LOAD, mov->title);
getline(LOAD, mov->star);
getline(LOAD, mov->yr);
getline(LOAD, mov->garbage); //collect my aterisks
movieList.push_back(*mov);
}
LOAD.close();
LOAD.clear();
///////////////////////////////////load customers into template
LOAD.open("customers.txt", ios::app | ios::beg);
if(!LOAD.is_open())
{
cout << "Could not open customers.txt";
cin.ignore();
cin.get();
exit(1);
}
customerList.clear();
while(!LOAD.eof())
{
customer *cust = new customer;
getline(LOAD, cust->name);
getline(LOAD, cust->age);
getline(LOAD, cust->gender);
getline(LOAD, cust->garbage);
customerList.push_back(*cust);
}
LOAD.close();
LOAD.clear();
}