第三课的课后练习
2015-12-18 18:55
351 查看
#pragma once #include<iostream> using namespace std; class A { private: int n; public: A(void); ~A(void); void f(); virtual void g(void); }; #include "stdafx.h" #include "A.h" A::A(void) { } A::~A(void) { } void A::f() { } void A::g(void) { cout<<"A::g()"<<endl; } #pragma once #include "a.h" class AA : public A { public: AA(void); ~AA(void); int k; virtual void g(void); }; #include "stdafx.h" #include "AA.h" AA::AA(void) { } AA::~AA(void) { } void AA::g(void) { cout<<"AA::g()"<<endl; } #pragma once #include "a.h" #include"b.h" class AB : public A,public B { public: AB(void); ~AB(void); }; #include "stdafx.h" #include "AB.h" AB::AB(void) { } AB::~AB(void) { } #pragma once class B { public: B(void); ~B(void); int l; void h(void); }; #include "stdafx.h" #include "B.h" B::B(void) { } B::~B(void) { } void B::h(void) { } // Ex3_2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include"aa.h" #include"ab.h" int _tmain(int argc, _TCHAR* argv[]) { A a,*pa; AA aa,*paa; // pa=&a; // paa=&aa; // pa->g(); // paa->g(); pa=&aa; pa->g(); AB ab; system("PAUSE"); return 0; }
相关文章推荐
- #置换#Burnside引理Polya定理
- 第十一章
- [No00005B] word快速插入当前时间&怎样一次性删除文档中的全部链接
- android里Toast的用法
- SELinux policy问题解决思路总结
- 嵌入式开发之xml---xml解析
- php5.5以上版本编译扩展模块方法
- Xcode官方文档使用手册
- Xcode7.2之沙盒
- 高效率去掉js数组中重复项
- 给大家推荐几本经典技术书籍
- Mini2440裸机RTC时钟驱动转化为字符串显示
- android 获取屏幕大小和屏幕截图
- IOS 代码创建UI界面
- 【jQuery】使用post()方法以POST方式从服务器发送数据
- IOS NSString NSMutableString 不可变|可变字符串
- 手机端html5触屏事件(touch事件)
- php使用curl访问https
- NSDate iOS 日期
- 也说性能测试,顺便说python的多进程+多线程、协程