C++ Basic
感觉多少有点复杂
Def
A dangling pointer is a pointer that points to a location whose memory is deallocated.
dynamic objects are managed by heap, and stack vice versa. Temporary objects are managed by stack. And rvalue reference is an alias of a temporary object/value.
const int* is different from int* const. int* const相当于我们让一个const变量成为指针,比如int* const ptr = & x,那么实际上ptr作为一个const变量是不可变的,但是他指向的x的值是可变的,即* x = 5编译是可以通过的。相较之下,const int* ptr = & x则是ptr是changeable,x是unchangeable。
我告诉你一个小的技巧,就是c++k ...