填空题

有以下程序: #include <iostream> #include <string> using nameSpace std; class person { int age; Char * name; public: person ( int i, Char * str ) { int j; j = strlen( str ) + 1; name = new char[ j ]; strcpy( name, str ); age = i; } ~person() { delete name; cout<<"D"; } void display() { cout<<name<<":"<<age; } }; int main() { person demo( 30,"Smith" ); demo.display(); return 0; } 则该程序的输出结果为: 【13】

【参考答案】

Smith:30 D