I get error with constructor. I don't know what is wrong.
Date is the base class for all the hierarchy
1 2 3
This is constructor for Seniour worker
SeniourWorker(string &, string &, string &, int = 0, int = 0, int = 0,int=0);
1 2 3 4
JuniourWorker inherits from SeniourWorker and has the same constructor
JuniourWorker::JuniourWorker(string &first, string &last, string &ssn, int d, int m, int y, int b)
:SeniourWorker(first,last,ssn,d,m,y,b)
This is where i get the error in main
1 2 3 4
vector <Date*> bus(2); //polymorphic bus
bus.at(0) = new JuniourWorker("Kouatcha","Calson","FE13400",3,4,1994,6);
bus.at(1) = new SeniourWorker("Acha","Bill","FE13A041",4,9,1993,9);
Visual Studio tells me my string arguments for JuniourWorker and SeniourWorker are constchar * .
Is this the reason for the contrast with string & in the deceleration?
If this is the reason, how do i input string arguments in the initialization of the constructors without explicitly declaring string variables for them?