class employee {
public :
employee (char *inName, char *inPosition, double inSalary =0.0);
~employee();
char getName()const;
char getPosition()const;
double getSalary()const;
virtual void display();
private :
char name[40];
char position[40];
double salary;
protected:
void setName(char inName);
void setPosition(char inPosition);
void setSalary(double inSalary);
};
employee::employee(char *inName, char *inPosition, double inSalary){
setName(*inName);
setPosition(*inPosition);
setSalary(inSalary);
}
//destructor
//setter
//getter
void employee::display(){
cout<<"Employee Name Is :"<<getName()<<endl;
cout<<"Employee Position Is :"<<getPosition()<<endl;
cout<<"Employee Salary :"<<getSalary()<<endl;
}
int main{
char *x ="bello";
employee e1(x, "123",50);
e1.display();
}
How could i possibly solve this problem as in my employee e1(x, "123",50), I have receive a message of: Deprecated conversion from string constant to 'char*. What is the possible solution?