I am the beginner of C++, just start to learn struct. 
I create the struct and read the data from a file.

Here is my file:

**John Smith 26832904 1657 Commerce st Flushing NY 11204 7183942833 company01 962 51**

I successfully input the data to the struct. The output is perfect but just having a zero at the end, which can drive me crazy. 

This is my entire code:

```
#include<iostream>
#include<string>
#include<fstream>
#include<iomanip>
using namespace std;

struct nametype
{
    string first;
    string last;
};

struct addresstype
{
    string address1;
    string address2;
    string address3;
    string city;
    string state;
    string zip;
};

struct contacttype
{
    string home;
    string person;
};

struct employeeType
{
    nametype name;
    string id;
    addresstype address;
    contacttype contact;
    string worklocate;
    double basewage;
    int carsale;
};

int main()
{
    ifstream infile;
    infile.open("employeeInfor.txt");
    if (!infile)
    {
        cout << "Error." << "\n";
    }

    employeeType employee;
    employee.basewage = 0.0;
    employee.carsale = 0;

    infile >> employee.name.first >> employee.name.last
        >> employee.id
        >> employee.address.address1 >> employee.address.address2
        >> employee.address.address3 >> employee.address.city
        >> employee.address.state >> employee.address.zip
        >> employee.contact.home >> employee.contact.person
        >> employee.worklocate
        >> employee.basewage >> employee.carsale;
    cout << employee.name.first <<" "<<employee.name.last
        << " " << employee.id
        << " " << employee.address.address1 << " " << employee.address.address2
        << " " << employee.address.address3 << " " << employee.address.city
        << " " << employee.address.state << " " << employee.address.zip
        << " " << employee.contact.home << " " << employee.contact.person
        << " " << employee.worklocate
        << " " << employee.basewage << " " << employee.carsale << "\n";

    infile.close();
    system("pause");
    return 0;
}

```

I output the data. That's what I got: 

[The end of the extra 0 is not my expectation.](https://i.stack.imgur.com/9k0mq.png)

By the way. I want to put the struct within the array. To make this function work for more than one employee. I know should be create the struct like, employeeType employees[5];
I just stuck from reading the file. Can't keep moving.