![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C / C++
pumpkindyy
这个作者很懒,什么都没留下…
展开
-
内存管理
C++中,关于动态内存的是new and delete。在C++中,new operator是C++内建的行为。任何人(也许除了Bjarne Stroustrup)都无法改变。new operator先调用一个名为operator new的函数动态申请内存。标准模式就像这样: void* operator new(size_t size); 然后在传回的void*指针上进行构造的行为。原创 2005-08-15 15:56:00 · 767 阅读 · 1 评论 -
Const & Pointer
int const *ptr 等同于const int *ptr, 都表示指向整形常量的指针, 指针指向的地址可变,但是指向的地址里面的内容不可变。int* const ptr表示指向整形变量的指针常量,指针指向的地址不可变,但是指向的地址里面的内容可变。const int* const ptr 则表示指向整形常量的指针常量,指针指向的地址不可变,但是指向的地址里面的内容也不可变。const *原创 2005-08-11 11:16:00 · 613 阅读 · 0 评论