![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++
TheHuan_9
这个作者很懒,什么都没留下…
展开
-
C++ 实现字符串类(重载运算符)
mystring.h#include<iostream>using namespace std;#ifndef MYSTRING_H#define MYSTRING_Hclass MyString{ friend ostream& operator<<(ostream&out,MyString &ob);//友元函数重载<<的友元声明 friend istream& operator>>(istre原创 2021-07-07 18:15:14 · 2588 阅读 · 1 评论 -
C++中函数返回值为对象
Data类class Data{private: int a; int b;public: Data() { this->a=0; this->b=0; cout<<"无参构造"<<endl; } Data(int a,int b) { this->a=a; this->b=b; cout<<原创 2021-07-06 03:54:19 · 1508 阅读 · 0 评论