第十三周上机实践项目:阅读程序,并运行结果(虚析构函数)
2016-06-06 19:16
411 查看
/* *Copyright(c) 2016.烟台大学计算机与控制工程学院 *ALL rights reserved. *文件名称:main.cpp *作者:赵子琳 *完成日期:2016年6月6日 *问题描述:阅读程序,并运行结果(虚析构函数) */ #include<iostream> using namespace std; class BASE { private: char c; public: BASE(char n):c(n){} virtual ~BASE(){cout<<c;} }; class DERIVED:public BASE { private: char c; public: DERIVED(char n):BASE(n+1),c(n){} ~DERIVED(){cout<<c;} } ; int main() { DERIVED *p,d('x'); return 0; }
相关文章推荐
- Ubuntu wine / winetricks解决this msxml 6.0 is not supported on the current processor type
- Android Intent调用大全、系统自带Intent调用大全
- keras
- undefined reference to `png_create_write_struct'问题解决
- Android Sqlite 数据库版本更新
- 环形缓存(java版)
- 十分钟搞定pandas
- 数据库技术分享
- 二叉树的镜像20
- 【leetcode】230. Kth Smallest Element in a BST
- 说说Android的广播(2) - 并发队列和串行队列
- socket与TCP/UDP编程
- SVG实现描边动画
- android学习2#--studio目录结构
- PHP-超全局变量
- HDU 1005 Number Sequence
- 通过学习学生信息管理系统软件,C程序中,如何设计和编写一个应用系统?
- sed 之 -n p
- 2016NEFU集训第n+3场 G - Tanya and Toys
- IOS集合视图