Explain Composition in C++ with an example

Composition allows software to be developed by assembling existing components rather than creating new ones. Composition is also sometimes called as aggregation and defines the process of putting an object inside another object. It models the has-a relationship. E.g. a class employee can contain an object of type salary which itself is another type of object. e.g.
class Salary{ private: double DA; double HRA; double travelAllowance; double basic salary; public: //member functions};Class Employee{ private: int empno; Salary salary; //composition: salary object is contained inside employee public: //member functions};

Re: Explain Composition in C++ with an example

I don't get it you need to explain it scientifically in the form of the dikoslasky form or else most coders will not unterstand

 
 

well

that's because you are retarded