#include #include using namespace std; //------------------------------------------------------------- class Person { public: string firstName ; string lastName ; int age ; public: void print() { cout << firstName << " : " << lastName << ": " << age << endl ; } ~Person() { cout << "Person Destructor for " << firstName << " : " << lastName << endl ; } Person() { age = 42 ; firstName = "Sunny" ; lastName = "Liston" ; cout << "Person constructor with no arguments." << endl ; } Person( int ageP ) { age = ageP ; firstName = "Jack" ; lastName = "Johnson" ; cout << "Person constructor with single argument." << endl ; } Person(int ageP, string firstNameP, string lastNameP) { age = ageP ; firstName = firstNameP ; lastName = lastNameP ; cout << "Person Constructor with arguments.\n" ; } }; //------------------------------------------------------------- int main() { Person arrayOfObjects[5] = { Person(20, "Joe", "Louis") , 52 } ; for( int i1=0 ; i1 < 5 ; i1++ ) { arrayOfObjects[i1].print() ; } //for return(0) ; }