TISTORY 관리센터 썸네일형 리스트형 클랙스 동적 할당과 해제 //Default3.h #include class Person { int age; char* name; char* phone_num; public: Person(int _age,char *_name, char* _phone_num); ~Person(); void showdata(); // void Delmemory(); }; //Default3.cpp #include "Default3.h" #include using std::cout; using std::endl; Person::Person(int _age ,char *_name, char* _phone_num) { age=_age; name=new char[strlen(_name)+1]; strcpy(name,_name); phone_num=new c.. 더보기 이전 1 다음