// Ex10_02.cpp : Extending the test operation #include using namespace std; #include "Name.h" // Function to initialize an array of random names void init(Name* names, int count) { char* firstnames[] = { "Charles", "Mary", "Arthur", "Emily", "John"}; int firstsize = sizeof (firstnames)/sizeof(firstnames[0]); char* secondnames[] = { "Dickens", "Shelley", "Miller", "Bronte", "Steinbeck"}; int secondsize = sizeof (secondnames)/sizeof(secondnames[0]); char* first = firstnames[0]; char* second = secondnames[0]; for(int i = 0 ; i names[j]) phrase = " greater than "; else if(names[i] == names[j]) // Superfluous - but it calls operator==() phrase = " equal to "; jName = new char[names[j].getNameLength()+1]; // Array to hold second name cout << endl << names[i].getName(iName) << " is" << phrase << names[j].getName(jName); delete[] jName; } delete[] iName; } delete[] pName; cout << endl; return 0; }