#include <iostream>
#include<cstring>
using namespace std;
class my_string
{
public:
my_string(){}
my_string(char *s)
{
len=strlen(s);
str=new char[len];
str=s;
}
my_string(const my_string& O)
{
str=O.str;
len=O.len;
}
my_string& operator=(const my_string& R)
{
if(this!=&R)
{
str=R.str;
len=R.len;
}
return *this;
}
void display()
{
cout<<str<<'\t'<<len<<endl;
}
bool my_empty()
{
if(len==0)
return false;
else
return true;
}
int my_size()
{
return len;
}
char *my_str()
{
return (char*)str;
}
private:
char *str;
int len;
};
int main()
{
my_string s1("zhangsan"),s3("lisi");
my_string s2(s1);
cout<<s2.my_empty()<<'\t';
cout<<s2.my_size()<<'\t';
s2.display();
s1=s3;
s1.display();
s3.display();
/* cout << "Hello World!" << endl;*/
return 0;
}