ErrorC2665 overloads could convert
Cant find out whats wrong with this function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
void load(vector<Konto>&konton)
{
ifstream fin("Bank.txt");
int kontonummer;
string innehavare;
double saldo;
double rantesats;
konton.clear(); // Clear the contents of konton
while(fin >> innehavare >> kontonummer >> saldo >> rantesats)
{
// Line below, (Konto, creates error C2665: 'Konto::Konto' : none of the 3 overloads convert all the argument types.
konton.push_back(Konto(innehavare, kontonummer, saldo, rantesats));
}
BubbleSort(konton);
cout << "Sort order by age, youngest first:" << endl;
for (unsigned int i = 0; i < konton.size(); i++)
{
cout << konton[i].Innehavare() << " " << konton[i].Kontonummer() << endl;
}
cout << "\n" << endl;
}
|
This solved it!
konton.push_back(Konto(kontonummer, innehavare, saldo, rantesats));
Topic archived. No new replies allowed.