no matching function error

Im having trouble with my code I have an error that I cant figure out.
error: no matching function for call to ‘employee::employee(double, double)’
employee* e = new employee(atof(i.c_str()),atof(x.c_str()));
^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  ifstream ifn("exception.txt");
 32 while(!ifn.eof() )
 33 {
 34 
 35 getline(ifn,i,'|');
 36 if(ifn.eof())
 37         break;
 38 getline(ifn,x);
 39 employee* e = new employee(atof(i.c_str()),atof(x.c_str()));
 40 char a = 'A';
 41 x.push_back(a);
 42 
 43 for(int i; i<x.size(); i++)
 44 {
 45 
 46 if (id==employee*->x())
 47 
 48 w.add_exception();
 49         break;
 50 }
 51 }
 52 ifn.close();
The error seems rather clear: you do call employee::employee(double, double), but your class employee does not have a constructor that takes two double parameters.
I do here.
#include"depot.h"
7
8
9 depot::depot(int num)
10
11 {
12 employee* w(string n,int i,int g);//right here
13 string i;
14 string n,g;
15 string x;
16 ifstream fin("employee.txt");
17 while (!fin.eof())
18 {
19
20 getline(fin,i,'|');
21 if(fin.eof())
22 break;
23 getline(fin,n,'|');
24 getline(fin,g);
25 employee* e = new employee(n,atof(i.c_str()),atof(g.c_str()));
26
27 char c = 'C';
28 x.push_back(c);
29 }
30 fin.close();
31 ifstream ifn("exception.txt");
32 while(!ifn.eof() )
33 {
34
35 getline(ifn,i,'|');
36 if(ifn.eof())
37 break;
38 getline(ifn,x);
39 employee* e = new employee(atof(i.c_str()),atof(x.c_str()));
40 char a = 'A';
41 x.push_back(a);
42
43 for(int i; i<x.size(); i++)
44 {
45
Topic archived. No new replies allowed.