![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++
qq_910076521
这个作者很懒,什么都没留下…
展开
-
类中不写成员函数易犯错误
代码:#includeusing namespace std;class circle{public: double r; double pi=3.1415926; double area=r*r*pi;};int main(){ circle c1; double r; cout"请输入r:";原创 2017-09-29 23:03:54 · 290 阅读 · 0 评论 -
delete或者free之后为什么要将指针指为NULL
首先我们来看一段代码#include <iostream>using namespace std;int main(){ int *p = new int; *p = 3; cout << *p << endl; cout << p << endl; delete p; cout << *p <...原创 2018-10-14 19:44:04 · 1810 阅读 · 0 评论 -
深浅拷贝(C++)
浅拷贝主要出现的问题是不是值拷贝:先看代码#include <iostream>using namespace std;class Test{public: Test(){}; Test(char *p) { this->ptr = p; } ~Test() { if (this->ptr != NULL) { delete t...原创 2018-10-15 20:28:06 · 152 阅读 · 0 评论 -
c++之智能指针
https://www.cnblogs.com/heleifz/p/shared-principle-application.htmlshared_ptr:https://www.cnblogs.com/heleifz/p/shared-principle-application.htmlauto_ptr作为一个已经被摒弃得指针,有什么缺点呢,先看代码#include <...原创 2019-03-18 19:14:29 · 111 阅读 · 0 评论 -
图说C++对象模型:对象内存布局详解
https://www.cnblogs.com/QG-whz/p/4909359.html#_label3_0转载 2019-08-19 11:16:24 · 120 阅读 · 0 评论 -
C++ lambda表达式入门
https://blog.csdn.net/a379039233/article/details/83714770转载 2019-08-19 19:40:15 · 152 阅读 · 0 评论 -
关于迭代器失效的几种情况
https://blog.csdn.net/qq_37964547/article/details/81160505转载 2019-08-20 10:31:11 · 128 阅读 · 0 评论 -
make_pair
https://blog.csdn.net/weixin_42825576/article/details/81571419转载 2019-10-08 10:38:52 · 102 阅读 · 0 评论