int main(int argc, char* argv[]) { C_Class A *ma,a. C_Class B *mb,b.
A_Creat(&.a).//实例化 B_Creat(&.b).
mb=&.b. ma=&.a.
ma=(C_Class A*)mb.//引入多态指针 printf("%d ",ma->a).//可惜的就是 函数变量没有private ma->Foo(ma).//多态 a.Foo(&.a).//不是多态了 B_F2(&.b).//成员函数,因为效率问题不使用函数指针 return 0. } 输出结果: 11 It is B.c=13 It is A.a=1 It is B_Fun