mercredi 27 novembre 2019

How do we store a reference to an object in the pointer?

I am thinking of this solution, but not sure if it is correct.

Type* myObjP;

void setSmth(Type& toBePassed) {
  myObjP = *toBePassed;
};

Aucun commentaire:

Enregistrer un commentaire