I am trying to pass an array that points to a Worker class object that I have created. I need another class to access the object parameters so I am passing it in a function. Having some difficulty.
class Manager:public Employee
{
public:
Manager();
void LoadEmployee();
string getName();
string getEmail();
string getTelNum();
//string getLocation();
virtual ~Manager();
private:
staticconstint kingston_employees = 20;//find out how to change the size without have to modify code
staticconstint mobay_employees = 10;
//Array of pointers to the Worker Object type
Worker *arr_king[kingston_employees + 1];
Worker *arr_mobay[mobay_employees + 1];
pass(arr_king);//FUNCTION TO PASS POINTER TO OBJECTS
here is a stylized example with two embellishments (so to speak): (a) std::vector instead of C-style array, (b) std::unique_ptr instead of C-style pointer: