What will be displayed as a result of the execution of the following code?
#include <iostream>

struct A
    std::cout << "~A";

struct B: public A
  virtual ~B()
    std::cout << "~B";

int main()
  A *a = new B();
  delete a;
  return 0;
A class destructor is not virtual, so the version of the destructor defined in this class will be called.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Зарегистрируйся сейчас
или Подпишись на будущие тесты