Thread: 1 error
View Single Post
Old 05-29-2009, 05:41 AM   #1 (permalink)
effective
Registered User
 
Join Date: May 2009
Posts: 6
OS: 2


Post 1 error

Code:
#include<iostream.h>
#include<string.h>
#include<conio.h>
const int len=30;
enum contract{permanent,temporary};
class Employee{
	protected:
	char name[len];
	long int ID;
	double salary;
	public:
	Employee() **}
	Employee(char n[len],long int id, double s)**
	strcpy(name,n);
	ID=id;
	salary=s;}
	void setEmp(char [len],long int id,double s) **
		cout<<"\nName of Employee: "<<name;
		cout<<"\nID of Employee: "<<ID;
		cout<<"\nSalary of Employee: "<<salary;
	}
	friend ostream& operator << (ostream&,Employee &);
};
ostream& operator << (ostream & out,Employee & n) **
			out <<n.name<<"----" <<n.ID<<"-----"<<n.salary<<endl;
			return out;
		}
class Manager: public Employee **
	private:
	char degree[len];
	public:
	Manager (char n[len],long int id,double s,char d[len])**
	Employee::Employee(n,id,s);
	strcpy(degree,d);}
	void setEmp(char n[len], long int id, double s, char d)**
		Employee::setEmp(n,id,s);
		cout<<"\nDegree of Employee: "<<degree;
	}
	friend ostream& operator << (ostream&,Manager &);
};
ostream& operator << (ostream & out,Manager & n) **
			out <<n.name<<"----" <<n.ID<<"-----"<<n.salary<<"-----"<<n.degree<<endl;
			return out;
		}
class Secretary: public Employee **
       private:
	contract contractType;
       public:
	Secretary(char n[len],long int id, double s,contract c)**
		Employee::Employee(n,id,s);
		contractType=c;}
	void setEmp(char n[len], long int id, double s, contract c)**
		Employee::setEmp(n,id,s);
		cout<<"\nContract Type of Employee: "<<contractType;
	}
	friend ostream& operator << (ostream&,Secretary &);
};
ostream& operator << (ostream & out,Secretary & n) **
			out <<n.name<<"----" <<n.ID<<"-----"<<n.salary<<"----"<<n.contractType<<endl;
			return out;
		}
int main() **
	Employee p( "Silva", 1234567, 500.0);
	Manager p1( "Silva Mikaido",234567, 1000.0, "Dr.");
	Secretary p2;
	p2.setEmp( "Sizer", 341256, 400.0,permanent);
	cout<< "Manager p1 is "<<p1;
	cout<< "Secretary p2 is "<<p2;
	return 0;
}
When compile 1 error appear:
"Could not find a match for 'Secretary:Secretary()'
Help me !

Last edited by effective; 05-29-2009 at 05:44 AM.
effective is offline   Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here