
c/c++
代码界的小姑娘
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
c/c++带有默认参数的函数
函数参数默认值从右到左设定,调用函数传递参数从左往右传默认值函数调用,实参push入栈没有变化参数默认值具有唯一性,默认,从上到下 从右往左函数声明int max(int a,int b);int max(int a,int b=10);int max(int a = 10,int b = 10);调用int ret = max(10,10);等价于i...原创 2018-07-24 22:41:19 · 3946 阅读 · 1 评论 -
c++智能指针
智能指针是什么智能指针是一个类,这个类的构造函数中传入一个普通指针,析构函数中释放传入的指针。智能指针的类都是栈上的对象,所以当函数(或程序)结束时会自动被释放智能指针产生背景case 1 1 void test1(string &str) 2 { 3 string *ps = new string(str); 4 ... 5 ...原创 2018-08-18 15:51:23 · 170 阅读 · 0 评论