2
Mengapa destruktor dieksekusi dua kali?
#include <iostream> using namespace std; class Car { public: ~Car() { cout << "Car is destructed." << endl; } }; class Taxi :public Car { public: ~Taxi() {cout << "Taxi is destructed." << endl; } }; void test(Car c) {} int main() { Taxi taxi; test(taxi); return 0; } ini …