void InitClass() { int* array = new int[1024*2024+3]; for (size_t i = 0; i < 1024*2024+3; i++) { array[i] = i+i^i-2*i+1; } if (array) { delete[] array; array = nullptr; } { //2.1创建类对象 Person person;//Class Person person; cout << "person.Number:" << person.Number << endl; cout << "person.Address:" << person.Address << endl; cout << "person.Sex:" << person.Sex << endl; cout << "person.BirthDay.Year:" << person.BirthDay.Year << endl; cout << "person.BirthDay.Mounth:" << person.BirthDay.Mounth << endl; cout << "person.BirthDay.Day:" << person.BirthDay.Day << endl; cout << "person.GetBirthDay():" << person.GetBirthDay() << endl; if (person.IsImmigrant) { cout << "person.IsImmigrant:" <<"true" << endl; } else { cout << "person.IsImmigrant:" << "false" << endl; } } { //2.2创建类指针 Person* person = new Person(1); cout << "person.Number:" << person->Number << endl; cout << "person.Address:" << person->Address << endl; cout << "person.Sex:" << person->Sex << endl; cout << "person.BirthDay.Year:" << person->BirthDay.Year << endl; cout << "person.BirthDay.Mounth:" << person->BirthDay.Mounth << endl; cout << "person.BirthDay.Day:" << person->BirthDay.Day << endl; cout << "person.GetBirthDay():" << person->GetBirthDay() << endl; cout << "person.IsImmigrant:" << person->IsImmigrant << endl; if (person) { delete person; } } }