Код: Выделить всё
surname
first name
0123456789
an address
none
1920
0
*
motorcycle1
0
Код: Выделить всё
while (getline(inputfile, inputline))
{
if (inputline == "*")
{
break;
}
else
{
inputfile.putback('\n');
inputfile.seekg(-inputline.length(), ios::cur);
inputfile >> inputcustomer;
customerlist.push_back(inputcustomer);
}
}
while (getline(inputfile, inputline))
{
if (inputline == "")
{
break;
}
else
{
inputfile.putback('\n');
cout inputmotorcycle;
cout (istream& is, Customer& c)
{
getline(is, c.name);
getline(is, c.vorname);
getline(is, c.telefonnummer);
getline(is, c.addresse);
getline(is, c.motorcycle);
is >> c.geburtsjahr;
is.ignore();
string f;
getline(is, f);
if (f == "1")
{
c.fuhrerscheina = true;
}
else
{
c.fuhrerscheina = false;
}
return is;
}
ostream& operator
Подробнее здесь: [url]https://stackoverflow.com/questions/79276706/ifstream-creating-an-extra-element-at-the-beginning-of-a-list[/url]
Мобильная версия