How does one make an object null? I think in Java, one could merely dobut I could be wrong. Basically, I have an array of objects and I want to delete one of the objects. I think null is the way to do it, no?Code:anObject = null;
Secondly, I have this..
I can't figure out how to instaniate empList to maxNumOfEmps and also to instantiate maxNumOfEmps to 100 and empNotFound to -1.Code:class EmpArys { public: EmpArys(); int findEmp(int pSocSecNbr); Employee getEmp(int pSocSecNbr); bool addEmp(Employee pEmp); bool delEmp(int pSocSecNbr); string toString(); string getPayList(Tax pTaxTable); private: Employee empList[100]; //i've temporarily put 100 there int empCount; const int maxNumOfEmps, empNotFound; };
I can't instantiate them in the constructor because they are constant and not in the class either. Major help needed.
I tried this for instantiating the object in the constructors, which would work in Java (I think), but not in C++
Thanks, I greatly appreciate the help.Code:EmpArys::EmpArys() { empArys[maxNumOfEmps]; }