代码1 #include <vector> #include <stdio.h> class A { public: A() { printf("A()/n"); } ~A() { printf("~A()/n"); } A(const A& other) { printf("other/n"); } }; int main() { A a; A b(a); A c = a; return 0; } 执行结果1 A
#include <vector> #include <stdio.h> class A { public: A() { printf("A()/n"); } ~A() { printf("~A()/n"); } A(const A& other) { printf("other/n"); } }; int main() { A a; A b(a); A c = a; ; } 执行结果1 A() other oth
7 类B是类A的公有派生类, 类A和类B中都定义了虚函数func(), p 是一个指向类A对象的指针,则p->A::func()将() A 调用类A中的函数 B 调用类B中的函数 C 根据p所指向的对象类型而确定调用类A中的函数或类B的函数 D 都调用 13 下列语句正确的是() A int a, &ra = a, &&ref = ra B int &rafa[10] C int a,&ra = a, &*refp = &ra D int *p