Stupid question, but I can't figure it out


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

Posted by Tim on November 29, 2001 at 15:02:34:

I am trying to use the following codes to read in the car data from CarCreation.txt

while( !ins_1.eof())
{
getline(ins_1, license, '\t');
getline(ins_1, man_name, '\t');
getline(ins_1, model, '\t');
getline(ins_1, weight, '\t');
ins_1 >> loc;
ins_1.get(space);
}
"loc" is integer type and space is character type.

It works fine except the last row of car data has initialized twice

e.g.
KVF 2794 Lincoln Mark VIII 4450 83
83

Thanks for any help.


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]