I have a text file of prisoner records:
Roy MOYES ARSON 35
Damien SIEBERT OTHER 37
Nigel COMYN ROBBERY 46 59000
Gai CRABBE OTHER 95
Stacey BEGLEY OTHER 80
I am trying to read this into a class object of prisoner:
void Prison::ReadCrimFile(){
ifstream fin;
fin.open("crims.txt");
if(!fin.good())
cerr << "File not found!\n" << endl;
else
while(!fin.eof()){
fin >> FirstName >> FamilyName >> Crime >> Months;
Criminal* C = new Criminal(FirstName, FamilyName, Crime, Months, i);
Crims.insert(C);
}
fin.close();
cout << "There are" << " " << Crims.size() << " " <<"criminals on
record" << endl;
}
When I run it though it doesn't produce any output at the end, there's just blinking cursor in the console window