跳转至

string

动态分配内存

new & delete

C++
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++
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++
extern const int buf = 4;


最后更新: 2026年4月4日 01:35:32
创建日期: 2026年4月4日 01:35:32