Разница между «наследовать от класса» и «наличие члена - это сам класс» ⇐ C++
-
Гость
Разница между «наследовать от класса» и «наличие члена - это сам класс»
What is the differences between these two child classes generally, and specifically in relation to memory:
(1)
class parent{}; class child : parent{}; (2)
class parent{}; class child{ parent parent_object; }; Is that true that whatever functionality we can achieve with (1) we can achieve with (2) too?
What is the differences between these two child classes generally, and specifically in relation to memory:
(1)
class parent{}; class child : parent{}; (2)
class parent{}; class child{ parent parent_object; }; Is that true that whatever functionality we can achieve with (1) we can achieve with (2) too?
Мобильная версия