hi plzzz i need ahelp to know what rong with this program
the problem is in the display function
the code
#include <iostream.h>
#include<string.h>
class Employee
{
private:
char number[55], name [55], salary[55];
public:
Employee();
~Employee();
void set();
void display ();
};
Employee::Employee()
{
cout<<"The constructor called"<<endl;
}
Employee::~Employee()
{
cout<<"the object deleted"<<endl;
}
void Employee::set()
{
int i,j;
for( i=0;i<3;i++){
for(j=0;j<i;j++){
cout<<"Enter the employee name"<<endl;
cin>>name;
cout<<"Enter the employee number"<<endl;
cin>>number;
cout<<"Enter the employee salary"<<endl;
cin>>salary;
}}}
void Employee::display()
{
for(int i=0;i<3;i++)
{
cout<<"employee name is:"<<name[i]<<endl;
cout<<"employee number is:"<<number[i]<<endl;
cout<<"employee salary is:"<<salary[i]<<endl;
}}
void main()
{
Employee a;
a. set();
a. display();
}
<< moderator edit: added code tags: [code][/code] >>