上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 107 下一页
摘要: 1.指向常量的指针和指针常量 int a=0; const int *const p=&a; // *p=2;//error: assignment of read-only location '*(const int*)p' int *const p1=&a; *p1 =3;//正确 在p的生命中 阅读全文
posted @ 2020-10-29 20:11 lypbendlf 阅读(183) 评论(0) 推荐(0) 编辑
摘要: https://www.zhihu.com/question/26872913 这个解释非常好,重复包含就是重复定义,那么就会报错了。 阅读全文
posted @ 2020-10-29 17:52 lypbendlf 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 转自:https://www.cnblogs.com/mrlsx/p/5510496.html 1.NULL为0值,nullptr是指针对象 NULL是一个宏定义,c中NULL为(void*)0,而c++中NULL为整数0: //C语言中NULL定义 #define NULL (void*)0 // 阅读全文
posted @ 2020-10-29 17:03 lypbendlf 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 转自:https://www.zhihu.com/question/281940376 https://www.cnblogs.com/Yekko/p/13508941.html 这两个链接里说的有不一样的地方,到底以哪个为准,之后看cpprimer再确认。 1.基本概念 堆,英文是 heap,在内 阅读全文
posted @ 2020-10-28 20:28 lypbendlf 阅读(243) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/ii0789789789/article/details/94899531,这个讲的很好 1.ref和&的例子 链接中讲的例子很好。 2.函数式编程 是对参数直接进行拷贝,而不是引用。 void f(int &a,int &b,int &c){ cout< 阅读全文
posted @ 2020-10-28 19:20 lypbendlf 阅读(501) 评论(0) 推荐(0) 编辑
摘要: https://segmentfault.com/a/1190000007304644,这个举的例子非常好,容易理解。 1.线程冲突 线程间共享进程的资源,在访问时可能会出现 线程冲突、内存一致性错误,解决的方法是线程同步。 当两个运行在不同线程的操作,作用在同一个数据上,会发生线程冲突 (Thre 阅读全文
posted @ 2020-10-28 00:46 lypbendlf 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 转自:https://leetcode-cn.com/problems/binary-tree-preorder-traversal/solution/leetcodesuan-fa-xiu-lian-dong-hua-yan-shi-xbian-2/ 1.递归解法 前中后遍历都很简单,就不写了。 阅读全文
posted @ 2020-10-28 00:24 lypbendlf 阅读(172) 评论(0) 推荐(0) 编辑
摘要: j 阅读全文
posted @ 2020-10-27 22:24 lypbendlf 阅读(565) 评论(0) 推荐(0) 编辑
摘要: https://www.zhihu.com/question/19801131,这个下面的回答都很高质量。 1、介绍 https://www.cnblogs.com/smartlife/articles/12519130.html 先传入后被调用的函数。也是普通函数,因为程序通过参数把该函数的函数指 阅读全文
posted @ 2020-10-27 19:08 lypbendlf 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 转自:https://www.cnblogs.com/wangguchangqing/p/6141743.html 1.区别 拷贝构造函数和赋值运算符的行为比较相似,都是将一个对象的值复制给另一个对象; 但是其结果却有些不同,拷贝构造函数使用传入对象的值生成一个新的对象的实例,而赋值运算符是将对象的 阅读全文
posted @ 2020-10-27 19:02 lypbendlf 阅读(589) 评论(0) 推荐(0) 编辑
上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 107 下一页