Basic
C & C++
int & new int()
#include <iostream>
using namespace std;
int main() {
int *a = new int(1);
cout<<a<<endl<<*a<<endl;
while (true) {
new int(1);
}
}
// 上面这段代码有内存泄露的问题
// 下面的不会
#include <iostream>
using namespace std;
int main() {
int *a = new int(1);
cout<<a<<endl<<*a<<endl;
while (true) {
// new int(1);
int b = 1;
}
}new/delete & malloc/free
new/delete VS malloc/free
delete VS delete[]
构造函数与析构函数调用
const用途
指针和引用
include <> & ""
共享/动态库和静态库
限定词
static
作用
const vs static
Struct & Class
struct in c VS struct in c++
特殊语法
临时对象的产生和运用
静态常量整数成员可在class内部直接初始化
操作符重载
C++没有finally语句怎么释放资源
最后更新于