- 0
- 0
- 约1.66万字
- 约 42页
- 2019-08-19 发布于广东
- 举报
MyString operator+(const char *s) // +号重载,这里表示 //MyString类型+字符串的情形 { char *q; q = new char[strlen(p) + strlen(s) + 1]; strcpy(q, p); strcat(q, s); MyString temp(q); delete []q; return temp; } MyString operator=(const MyString s) // 赋值号重载 { if(p!=NULL) { delete[]p; } p = new char[strlen(s.p)+1]; strcpy(p, s.p); return *this; }0 Mystring类(3) 继承和多态— 作业四 char operator[](int n) // []号重载 { return p[n]; } MyString operator+=(char *s) // +=号重载 { char *q; q = new char[st
您可能关注的文档
最近下载
- DG_TJ08-2135-2025 建筑装饰装修工程施工标准.pdf VIP
- 在线网课学习课堂《人工智能(北理 )》单元测试考核答案.docx VIP
- 室内保洁服务标准与流程.docx
- 2026年中国热敏软磁铁氧体材料数据监测报告.docx
- Sandvik装船机项目总结_工艺.ppt VIP
- 2024年飞行员招考应聘基础知识考试题库及答案.docx VIP
- 网络文明规范网络言行--中小学班会课件.pptx VIP
- 2025年测绘地理信息工程技术人员真题及答案.docx VIP
- 2024年湖北省中考数学试卷试题真题(含答案).docx VIP
- 2026年上海市中考英语试卷(含答案).pdf VIP
原创力文档

文档评论(0)