Sep 29, 2016 at 12:49am UTC
hi everyone
given below is a sample of code i am doing on my assingnment...assuming that my input is correct, can anyone help me print the 6 ID using the employee class using a function.
class Person{
private:
string name;
int ID;
public:
Person();
void setName(string){this->name = name;}
void setID(int){this->ID = ID;}
string getName(){return name;}
string getID(){return ID;}
};
class Employee{
private:
string address;
Person emp;
public:
void setEmployee(string,Person *p){
address = " ";
p = &emp;
}
Person getEmployee(){
return adress;
return p
}
};
const int MAX_SIZE = 6
int main ()
{
Person P1[];
Employee E1[];
int x;
for (int i=0;i<MAX_SIZE;i++)
{
x = i;
P1.setID(x);
address = "aaa";
E1.setEmployee(address,P1);
}
.
.
.//print id here
.
.
return 0;
}
looking forward to your assistance...
regards