Z:gnu-www-ja-helloworld--20bcbe-=23include =26lt;iostream.h=26gt;/en

class string { private: int size; char *ptr; public: string : size(0), ptr(new char('\0')) {} string(const string &amp;s) : size(s.size) {    ptr = new char[size + 1]; strcpy(ptr, s.ptr); }  ~string {    delete [] ptr; }  friend ostream &amp;operator &lt;&lt;(ostream &amp;, const string &amp;); string &amp;operator=(const char *); };
 * 1) include &lt;iostream.h&gt;
 * 2) include &lt;string.h&gt;

ostream &amp;operator&lt;&lt;(ostream &amp;stream, const string &amp;s) {  return(stream &lt;&lt; s.ptr); } string &amp;string::operator=(const char *chrs) {  if (this != &amp;chrs) {    delete [] ptr; size = strlen(chrs); ptr = new char[size + 1]; strcpy(ptr, chrs); }  return(*this); } int main {  string str; str = "Hello World"; cout &lt;&lt; str &lt;&lt; endl; return(0); } \