lundi 1 avril 2019

encapsulation and defining an object through another set of attributes

how to apply the encapsulation principle through code in order to acess a complex number through the polar coordonates btw why we don't pass the attribute by refrence to the constructor is there a specific type that requires to pass the correspondant attributes as a refrence
and how to add any basic type ( int , double ... ) to a complexe and having a complexe object returned (if we were to declare it as function [outside the class bloc] should we make it a friend instead

       double real ,imaginary;
       Complex (double , double) ;
       ~Complex () ;
};






Aucun commentaire:

Enregistrer un commentaire