diff --git a/practical_exercises/key_exercises/中括号重载.cpp b/practical_exercises/key_exercises/中括号重载.cpp index 23039bd..34225ac 100644 --- a/practical_exercises/key_exercises/中括号重载.cpp +++ b/practical_exercises/key_exercises/中括号重载.cpp @@ -5,6 +5,9 @@ struct Person { //职工基本信息的结构 double salary; char *name; + ~Person() { + delete []name; + } }; class SalaryManaege {