#include<iostream>
#include<cstring>
using namespace std;
//template<class T>
class myString
{
private:
char *str;
public:
myString() {
str = new char[1];
str[0] = '\0';
}
myString(const char* pStr)
{
if(pStr == NULL)
{
str = new char[1];
str[0] = '\0';
}else
{
str = new char[strlen(pStr) + 1];
strcpy(str, pStr);
}
}
myString(const myString& tmp)
{
str = new char[strlen(tmp.str)+1];
if(str != NULL) {
strcpy(str, tmp.str);
}
else {
str = NULL;
}
}
~myString()
{
delete str;
str = NULL;
}
myString &operator =(const myString &other)
{
if(this == &other)
return *this;
delete str;
str = new char[strlen(other.str)+1];
if(str != NULL) {
strcpy(str, other.str);
}
else {
str = NULL;
}
return *this;
}
};
int main()
{
return 0;
}