Funcion not matching error

I get a error on line 84 don't know what i'm doing wrong any ideas? Thanks

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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <string>

using namespace std;

class Personal
{
    string ime;
    int probation;
    int payment;
    string work;
    int user;

public:
    Personal(string name, int staj, int salary, string job, int client)
   {
        ime =name;
        probation=staj;
        payment=salary;
        work=job;
        user=client;
    }
    Personal () {}
    ~Personal () {}
    string GetName()
    {
        return ime;
    }
    int GetStaj()
    {
        return probation;
    }
    int GetSalary ()
    {
        return payment;
    }
    string GetJob()
    {
        return work;
    }

    int GetClient ()
    {
        return user;
    }

};

void outputLine( Personal );
int main()
{
   int i;
    Personal personal[3];

    string name;
    string job;
    int staj;
    int salary;
    int client;


    cout<<"Enter Name , Job , Staj ,Salary ,Clients : \n";

    for (i=0; i<3; i++)
    {
        cout<<"Enter Name :\n";
        cin>>name;

        cout<<"Enter Job :\n";
        cin>>job;

        cout<<"Enter Staj : \n";
        cin>>staj;

        cout<<"Enter Salary :\n";
        cin>>salary ;

        cout<<"Enter Clients :\n";
        cin>>client;

        Personal temp(name, job, staj, salary, client);
        personal[i]=temp;

    }

    ofstream outPersonalFile;
    outPersonalFile.open( "Personal.dat" );
    if ( !outPersonalFile )
    {
        cerr << "File could not be opened" << endl;
    }
    for (i=0; i<3; i++)
    {
        outPersonalFile <<  << personal[i].GetName()<< ' '<<personal[i].GetJob()<< ' ' << personal[i].GetStaj() << ' '<< personal[i].GetSalary()<<' '<< personal[i].GetClients() << '\n';
    }

    outPersonalFile.close();
    return 0;
}
Hey! You are giving the constructor your variables in the wrong order.

Personal(string name, int staj, int salary, string job, int client)

As you can see. It takes string, int, int, string and then int.

Personal temp(name, job, staj, salary, client);

Here you are giving it string, string, int, int and int. Just change the order.

Personal temp(name, staj, salary, job, client);
Thanks man you're awesome!
Topic archived. No new replies allowed.