prompt for each in this function?
Originally Posted by tabstop
Well, i guess then if i do that definitely need two separate functions for readin from user and file ... Which i was trying to avoid.. I prefer a code which can be reused ... Read() should cater for both keyboard & file ... If fact, if i do this indata >> Contract, how would it know if i'm calling the keyboard inout rather than the file input? will it decided based on the indata stream type?
std::istream& operator >> (std::istream& in, Contract& contract)
in >> contractID;
in >> carReg;
in >> carGrp;
in >> rentalType;
in >> iDate;
contract.SetContractDetails(iDate, carReg, rentalType, contractID, carGrp);
how would this function decide between the two streams?
istream& operator >> (istream& indata, Contract& contract)