Something missing
Posted
by
DHF
on Stack Overflow
See other posts from Stack Overflow
or by DHF
Published on 2012-09-04T03:22:58Z
Indexed on
2012/09/04
3:38 UTC
Read the original article
Hit count: 153
c++
The error of "} expected" appears at line 5. Why is that? I have included it at line 15.
The error of "Declaration missing ;" appears at line 8. Why? There is ";" at the end of the line.
#include<iostream>
using namespace std;
class PEmployee
{
public:
PEmployee();
PEmployee(string employee_name, double initial_salary);
void set_salary(double new_salary);
double get_salary() const;
string get_name() const;
private:
Person person_data;
double salary;
}; //line 15
int main()
{
PEmployee f("Patrick", 1000.00);
cout << f.get_name() << " earns a salary of "
<< f.get_salary() << endl;
return 0;
}
Newbie here, sorry for unclear question
© Stack Overflow or respective owner