C++中有无数的坑,但毕竟……
今天就踩到了,也算是基本问题了,记录一下,顺便以后可以考考自己。你也可以猜猜答案,大牛绕行。
0x1 先看这个:
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 class App 5 { 6 public: 7 ~App() 8 { 9 printf("\n~App\n");10 }11 void output()12 {13 printf("A");14 }15 };16 17 class Bpp : public App18 {19 public:20 ~Bpp()21 {22 printf("\n~Bpp\n");23 }24 void output()25 {26 printf("B");27 }28 };29 30 int main(char args[])
31 {32 Bpp* b = new Bpp();33 delete b;34 35 system("pause");36 return 0;37 }
延伸阅读
- ssh框架 2016-09-30
- 阿里移动安全 [无线安全]玩转无线电——不安全的蓝牙锁 2017-07-26
- 消息队列NetMQ 原理分析4-Socket、Session、Option和Pipe 2024-03-26
- Selective Search for Object Recognition 论文笔记【图片目标分割】 2017-07-26
- 词向量-LRWE模型-更好地识别反义词同义词 2017-07-26
- 从栈不平衡问题 理解 calling convention 2017-07-26
- php imagemagick 处理 图片剪切、压缩、合并、插入文本、背景色透明 2017-07-26
- Swift实现JSON转Model - HandyJSON使用讲解 2017-07-26
- 阿里移动安全 Android端恶意锁屏勒索应用分析 2017-07-26
- 集合结合数据结构来看看(二) 2017-07-26
学习是年轻人改变自己的最好方式
