Live quiz

cpp - Part 86

Question 1 of 25 Hints left: 3
Q1

What will be the output of the following C++ code? #include <new> #include <iostream> using namespace std; struct A { virtual ~A() { }; void operator delete(void* p) { cout << "A :: operator delete" << endl; } }; struct B : A { void operator delete(void* p) { cout << "B :: operator delete" << endl; } }; int main() { A* ap = new B; delete ap; }

  • A
  • B
  • C
  • D