/****************************************************************************************** ex3.cpp OOP object in a "traditional" array ******************************************************************************************/ #include <iostream> #include <string> using namespace std; //class definition class name { public: string first; string last; }; void main() { int i; const int maxsize=5; name family[maxsize]; for (i=0; i < maxsize; i++) { cout << "First: "; cin >> family[i].first; cout << "Last: "; cin >> family[i].last; } for (i=0; i < maxsize; i++) cout << family[i].last << ", " << family[i].first << endl; return; }