跳转至

string

动态分配内存

new & delete

C++
1
new int;

const

const is equal to #define in C. It declares a variable to have a constant value. And it can't change in program.

C++
1
2
const int x = 4;
x = 13;     # illegal!

A linenums="1" const in C++ defaults to internal linkage. - the compiler tries to avoiding creating storage for a const. - hold the value in its sample table - unless you make an explicit extern declaration.

C++
1
extern const int buf = 4;

最后更新 2026年4月4日 16:39:42 创建日期 2023年11月15日 17:30:52 字数 63 · 约 1 分钟 编辑此页