Как назначить атрибут, принадлежащий родительскому классу, дочернему классу с помощью конструктора в С++ [дубликат] ⇐ C++
-
Anonymous
Как назначить атрибут, принадлежащий родительскому классу, дочернему классу с помощью конструктора в С++ [дубликат]
this is my code. I'm new to c++
#include class Human { public: std::string gender; class Foo : public Human { public: std::string name; Foo(std::string gender, std::string name) { this->gender = gender; this->name = name; } }; }; int main(void) { Human::Foo foo("Male", "Foo"); std::cout
Источник: https://stackoverflow.com/questions/780 ... -class-usi
this is my code. I'm new to c++
#include class Human { public: std::string gender; class Foo : public Human { public: std::string name; Foo(std::string gender, std::string name) { this->gender = gender; this->name = name; } }; }; int main(void) { Human::Foo foo("Male", "Foo"); std::cout
Источник: https://stackoverflow.com/questions/780 ... -class-usi
Мобильная версия