#include <iostream>
#include <cstring>
using namespace std;
class A
{
private:
char *a;
public:
A(char *aa)
{
a=new char[strlen(aa)+1];
strcpy(a,aa);
}
~A()
{
delete []a;
}
void output()
{
cout<<a<<endl;
}
};
int main()
{
A a("good morning,code monkeys!");
a.output();
A b(a);
b.output();
return 0;
}
第六周项目一
最新推荐文章于 2021-03-26 20:41:10 发布