阅读程序1
来源:互联网 发布:windows 守护进程 编辑:程序博客网 时间:2024/05/23 23:47
#include <iostream>using namespace std;class A{ int a;public: A():a(5){} virtual void print()const {cout<<a;}};class B:public A{ char b;public: B(){b='E';} void print()const {cout<<b;}};void show (A &x){x.print();}int main(){ A d1,*p; B d2; p=&d2; d1.print(); d2.print(); p->print(); show(d1); show(d2); return 0;}
0 0
- noip2012 阅读程序1
- 11-阅读程序1
- 阅读程序1
- 阅读程序1
- 12程序阅读1
- 阅读程序1
- 阅读程序(1)
- 程序阅读1
- 阅读程序1、2
- 阅读程序补充-1
- 阅读程序1
- 阅读程序(1)
- 阅读程序1
- 阅读程序(1)
- 阅读程序(1)
- 14-阅读程序1-1
- 16-1阅读程序1
- 第十一周阅读程序1
- LeetCode:Binary Tree Inorder Traversal
- 数组类运算的实现
- linux进程间通信之无名管道通信学习笔记
- 半边数据结构(The_Half-Edge_Data_Structure)
- 【C#】.NET技术的发展及其跨语言和跨平台特性
- 阅读程序1
- 经典算法和数据结构(四) 平衡查找树之B树
- SDUT 2075 最少拦截系统
- 阅读程序2
- flask + MongoDB 学习笔记 (-1): 个人用记录
- 阅读程序3
- JSONObject
- PHP审计-RIPS
- 阅读程序4