samedi 30 décembre 2017

no match for 'operator>>' (operand types are 'std::basic_istream' and '') [on hold]

I'm programing a phonebook and there is something wrong in reading from the file. the error is: no match for 'operator>>' (operand types are 'std::basic_istream' and '') [on hold]

void PhoneBook::Load()
{
    ifstream file("test.txt");
                                //how i can make it(reading from file)correct?
    if (file.is_open())
    {
        file>>contact.first>>endl     
            >>contact.last>>endl     
                  >>contact.areacode>>endl 
                  >>contact.number>>endl
                  >>contact.email>>endl
                  >>contact.webaddr>>endl 
                  >>contact.address;
    }
    else
        cout<<"error in openening file";

}

Aucun commentaire:

Enregistrer un commentaire