网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
1 oop % ./String 2 String() 3 String(const char *s) 4 String(const String &obj) 5 String(const String &obj) 6 String(const char *s) 7 operator=(const String&) 8 oeprator=(const char*) 9 operator+(const String &, const String&) 10 String() 11 operator+(const String &, const String&) 12 String() 13 operator=(const String&) 14 operator<<(ostream&, const String &obj) 15 helloworld 16 operator+=(const String &obj) 17 operator<<(ostream&, const String &obj) 18 helloworldhello 19 operator+=(const char *s) 20 operator<<(ostream&, const String &obj) 21 helloworldhelloworld 22 operator[] 23 h 24 operator[] 25 operator<<(ostream&, const String &obj) 26 xelloworldhelloworld 27 operator>>(istream&, const String &obj) 28 hahaha #此行为输入 29 operator<<(ostream&, const String &obj) 30 hahaha 31 oop %
需要强调的是,运算符重载中有一个非常特殊的存在,那就是‘=’,它和拷贝构造函数有一定的功能重叠。当仅定义其中一个时(比如,只定义拷贝构造),使用‘=’运算符时同样不会报错,这是因为编译器对函数调用做了隐式转换。我的理解是,在不能完全肯定不会出错的情况下,要么就把各种情况下的函数都定义一遍,尽量不让编译器做出隐式转换,或者使用explicit关键字组织此类隐式转换。
最后,你的每一句留言都让博主欣喜若狂。
[
开发者涨薪指南
48位大咖的思考法则、工作方式、逻辑体系
](https://blog.csdn.net/programmer_editor/article/details/124704548?utm_campaign=marketingcard&utm_source=weixin_43302112&utm_content=121124609)
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上C C++开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
以戳这里获取](https://bbs.csdn.net/topics/618668825)**