Osmit O Osmit Регистрация 5 Сен 2013 Сообщения 82 Репутация 0 Спасибо 0 Монет 0 31 Окт 2016 #1 приведите пример програмы, где объекты одного класса вложенные в другой класс
drgf D drgf Регистрация 11 Авг 2013 Сообщения 84 Репутация 3 Спасибо 1 Монет 0 31 Окт 2016 #2 class Engine { public: void start() { cout << "drrrrr" << endl; } }; class Motorcycle { Engine engine; public: void start() { cout << "Motorcycle: "; engine.start(); } }; int main() { Motorcycle myMotorcycle; myMotorcycle.start(); } Позитивный голос 0
class Engine { public: void start() { cout << "drrrrr" << endl; } }; class Motorcycle { Engine engine; public: void start() { cout << "Motorcycle: "; engine.start(); } }; int main() { Motorcycle myMotorcycle; myMotorcycle.start(); }
КpОш К КpОш Регистрация 23 Дек 2013 Сообщения 76 Репутация 0 Спасибо 0 Монет 0 31 Окт 2016 #3 type TSomeClass=class end; TSomeOtherClass=class private SomeClass: TSomeClass; end; Позитивный голос 0