📄 pathologydemo1.cpp
字号:
#include <iostream>using namespace std;int main() { int* jp = new int(13); /* allocate and initialize */ cout << jp << '\t' << *jp << endl; delete jp; delete jp; /* error: pointer already deleted */ jp = new int(3); /* Reassign the pointer, memory leak. */ cout << jp << '\t' << *jp << endl; jp = new int(10); /* Reassign the pointer, memory leak. */ cout << jp << '\t' << *jp << endl; int* kp = new int(17); cout << kp << '\t' << *kp << endl; return 0;}/*OUTOOP> g++ pathologydemo1.cppOOP> ./a.out0x8049e08 130x8049e08 30x8049e08 10Segmentation faultOOP>*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -