123456789101112131415161718192021222324
class String{ protected: char* buf; int length; public String(){ buf = new char[1]; strcpy(buf, " "); length = strlen(buf); } int print(){ cout << buf << endl;; } ~String(){ delete [] buf; buf = NULL; } }; int main(){ String a; a.print(); return 0; }
678
String(){ buf = new char[1]; strcpy(buf, " ");
" "