str str s1 s2 t h i s \0 t h a t \0 String S1, S2; S1= “this”; S2 = “that”; str str s1 s2 t h i s \0 t h a t \0 S1 = S2; 深复制/深拷贝 ?将一个对象中指针变量指向的内容, ?复制到另一个对象中指针成员对象指向的地方 重载赋值运算符的意义 –浅复制和深复制 StringS1, S2; S1= “this”; S2= “that”; S1= S2; str str s1 s2 t h i s \0 t h a t \0 String S1, S2; S1= “this”; S2 = “that”; str str s1 s2 t h a t \0 t h a t \0 S1 = S2; StringS1, S2; S1= “this”; S2= “that”; S1= S2; 在class String里添加成员函数: String operator = ( const String s ) { if ( str ) delete [] str; str = new char[strlen(s.s
您可能关注的文档
最近下载
- TEM电子衍射(SAED)标定示例.docx VIP
- 起搏器心脏起搏器植入指南.pptx VIP
- 返璞归真macd的高级用法.ppt VIP
- 抗裂抹面砂浆合同(2篇).docx VIP
- 2024年内蒙古包头市中考数学试卷【含详细解析】.pdf VIP
- 建筑防火规范 GB50016.docx VIP
- 最新SMT车间作业流程图及工艺.docx VIP
- 中国融通资源开发集团有限公司物资接收、仓储人员专项招聘87人考试备考题库及详细答案解析.docx VIP
- CB_T 3253-2013 船用柴油机技术条件.pdf VIP
- 2026年龙岩市农业学校公开招聘新任教师7人笔试参考题库及答案解析.docx VIP
原创力文档

文档评论(0)