#include "car.h" int main() { Driver driver{"老王"}; Tyre tyre{"倍耐力"}; Car car1{tyre, driver}; car1.print(); // 正常 // 演示聚合可能的问题 Driver *temp = new Driver{"临时"}; // 动态申请的司机对象 Car car2{tyre, *temp}; car2.print(); // 正常 delete temp; // 释放司机对象 car2.print(); // 触发未定义行为 }