Just by looking, hopefully this can be resolved, because i have about 4 different user-defined classes that i would need to post up if need be. please help, I need to know why this while loop only passes once:
while (getline (cast, name, '\n'))
{
cast >> age;
cast >> junk;
Person* newCharacter = new Person (name, age);
fromFile.push_back(newCharacter);
}
age is int.
junk is string.
name is string.
cast is fstream (input).
fromfile is a vector <*Person> (person is a user defined class).
newCharacter is a Person.
please help. Again, I will post the classes if needed.
edit: oh yes, this is in C++, everyone.
while (getline (cast, name, '\n'))
{
cast >> age;
cast >> junk;
Person* newCharacter = new Person (name, age);
fromFile.push_back(newCharacter);
}
age is int.
junk is string.
name is string.
cast is fstream (input).
fromfile is a vector <*Person> (person is a user defined class).
newCharacter is a Person.
please help. Again, I will post the classes if needed.
edit: oh yes, this is in C++, everyone.