Consider my overloaded operator
This operator is a free function within Contract.h file and issued is declared inside the Contract class as privateCode:std::istream& operator >> (std::istream& in, Contract& contract) { std::string contractNo; std::string rentalType; unsigned lenderID; unsigned carReg; in >> contractNo; in >> lenderID; in >> carReg; in >> rentalType; // Error on below : error C2228: left of '.SetDate' must have class/struct/union Contract::issued.SetDate( Date::getCurrentTime() ); contract.SetContractDetails(issued, carReg, rentalType, lenderID, contractNo); return in; }
How do i access SetDate() properly?Code:#include "Date.h" class Contract { public: Contract(); private: Date issued, returned; }; std::istream& operator >> (std::istream& in, Contract& rental);



LinkBack URL
About LinkBacks



CornedBee