1234567891011121314
class pepe { private: int x; string y; double z; public: pepe(void){ x=0; y = " "; z = 0; } int getX() const { return x; } void setX(int const & a) { x = a; } void setY(string const & a) { y = a; } void setZ(double const & a) { z = a; } void printPepe(){ cout << x << y << z;} };
12345678910111213141516
class pepote { private: pepe mipepe; int x; string y; double z; public: pepote(void){ x=0; y = " "; z = 0; } int getX() const { return x; } void setX(int const & a) { x = a; } void setY(string const & a) { y = a; } void setZ(double const & a) { z = a; } pepe getPepe() const { return mipepe; } void pepote::printPepote(){ cout << x << y << z;} };
12345678910
int main() { pepote maspepe; maspepe.getPepe().setX(19); int p = maspepe.getPepe().getX(); cout << p; string temp; cin >> temp; return 0; }