mercredi 24 juillet 2019

How to call a class function which only argument is &

class Patient {
 public:
  const int patientId;
  const PatientKind kind;
  const bool hasInsurance;
  std::vector<ProcedureKind> procedures;
  Patient(int, PatientKind, bool);
  bool addProcedure(const ProcedureKind procedure);
  double billing();
  virtual double liability() = 0;
};
class Hospital {
 public:
  Patient &addPatient(const PatientInfo &);
};`

I don't know how to write Patient &Hospital::addPatient(const PatientInfo &) {

} Whatever I try to return or pass as argument gives me an error... Also, I don't understand what is this function expecting as an argument with just &? Any kind of help / insight will be appreciated :D

Aucun commentaire:

Enregistrer un commentaire