#include <iostream>

class string {
		public:
			string();
			~string();
			string& operator=(const string &);
			string& operator=(const char[]);
			void out();
		private:
			char *itsChar;
			int itsSize;
};

string::string():
	itsChar(0),itsSize(0)
{ }

string::~string() {
	if (!itsChar == 0)
		delete [] itsChar;
}

string& string::operator=(const string &rhs) {
	itsSize = rhs.itsSize;
	if (!itsChar == 0)
		delete [] itsChar;
	itsChar = new char[itsSize];
	itsChar = rhs.itsChar;
	return *this;
}

string& string::operator=(const char str[]) {
	itsSize = sizeof(str);
	if (!itsChar == 0)
		delete [] itsChar;
	itsChar = new char[itsSize];
	itsChar = const_cast<char*>(str);
	return *this;
}

void string::out() {
	std::cout << this->itsSize << "\n";
}

int main(void) {
	string* test = new string();
	*test = "hello world";
	test->out();
	return 0;
}
