Im writing a program to practice with the language, but im getting some pretty weird output from code that seems right to me.
The code:
#include <iostream>
#include <fstream>
#include <list>
struct Car
{
    std::string make;
    std::string model;
    int partNo;
    double price;
    int quantity;
    std::string partname;
};
void AddItem();
void _Update(int PartNo, int quantity);
void UpdateList(std::list<Car>& _Car);
int main()
{
    std::list<Car> _Car;
    UpdateList(_Car);
    for(std::list<Car>::iterator iter = _Car.begin(); iter != _Car.end(); iter++)
     {
         std::cout << iter->make << " " << iter->model << " " << iter->partNo << " " << iter->price << " " << iter->quantity << " " << iter->partname << std::endl;
     }
}
void UpdateList(std::list<Car>& _Car)
{
    std::ifstream File("CarParts.txt");
    if(!File.is_open())
        std::cerr << "Bad file input....... closing....";
    while(!File.eof())
    {
        Car tempObj;
        File >> tempObj.make >> tempObj.model >> tempObj.partNo >> tempObj.price >> tempObj.quantity;
        getline(File,tempObj.partname);
        _Car.push_back(tempObj);
    }
    File.close();
}
Outpost given:
 Pajero NA1H25 1 3.65 11 BLADE W/S WIPER Honda_Sivic R34gFk 2 4.97 15
 ENGINE CHANGE    2 4.97 15
Notepad file:
Pajero NA1H25 1 3.65 11 BLADE W/S WIPER
HondaSivic R34gFk 2 4.97 15 ENGINE CHANGE
what is with the three numbers under the two lines i actually wanted printed out? It's really confusing me... Thanks if you can help!