✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
What will the program output and which C++ mechanism causes this result?What will the program output and which C++ mechanism causes this result?#include <iostream> class A{public: virtual void Foo() { std::cout << "A"; }}; class B : public A{public: void Foo() override { std::cout << "B"; }}; int main(){ B b; A a = b; // ! a.Foo();}