U E D R , A S I H C RSS

Our Major Lang IsCAndCPlus Plus/2006.2.06/하기웅

~cpp
#include <iostream>
using namespace std;

class newstring {
public:
	char *str;

	newstring(char* s)
	{
		str = new char[strlen(s)+1];
		strcpy(str, s);
	}

	int length() const
	{
		return strlen(str);
	}
};

ostream& operator << (ostream& o, const newstring& ns) 
{
	cout << ns.str;
	return o;
}

int main()
{
	const newstring s="123";
	cout << s << "123";
	cout << s.length();
	return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:57
Processing time 0.0110 sec