could you tell me whats wrong?

I can't find whats wrong with the constructor and yet i get error invalid use of incomplete type 'class Employee'

//Employee class definition/interface
//contains employee first and last name and monthly salary
#include<string>
#include<iostream>

using namespace std;

class Employee
{
Public:
Employee(string, string, int);

void setEFName(string);//set method for first name

string getEFName();//get method for first name

void setELName(string);//set method for last name

string getELName();//get method for last name

void setEMSalary(int);//set method for monthly salary

int getEMSalary();//get method for monethly sarlary

void salaryRaise(int);

private:

string eFName;//contains first name

string eLName;//last name

int eMSalary;//monthly salary
};
First: in the future, please use [code][/code] tags around your code.

We'll need more information than that. And I highly recommend against using using namespace std; in a header file.
We need to know how you're using your class and how your constructor is implemented (it might be a good idea to have a default one as well), but before you go any further...
1
2
3
class Employee
{
Public: //It's not supposed to be capitalized. 


-Albatross
Thanks guys i'm very new to c++ i see that the problem was just a syntax one also i know a little better how to conduct myself on this forum
btw why do you recommend that i don't use the namespace std header file?
Ender210 wrote:
why do you recommend that i don't use the namespace std header file?

It is a bad habit that you will have to break when you write code professionally. Doing this causes every user of that header to get all of std:: in their global namespace, whether they wanted that or not.

It is not likely to affect you directly when you are writing code solely for yourself.

But you cannot get away with that writing code like that professionally. And it's easier to develop good habits now than to break bad habits on the job.
Because it's hidden inside a header file and it spreads to every .cpp file that uses that header.

EDIT: or what PanGalactic said.
Last edited on
oh i see thanks i'll keep that in mind from now on
Topic archived. No new replies allowed.