/* testarr11.cpp CIS 150 06/19/2008 David Klick This program demonstrates the use of an array of strings and parallel arrays. */ #include #include using std::cin; using std::cout; using std::setw; using std::left; void cont(); int main() { int i; const int ARRAY_SIZE = 4; // declare and initialize arrays of names // fname array stores first names // lname array stores last names // These are parallel arrays because the elements // with the same index in each array are related. char fnames[][15] = { "Bob", "Carol", "Ted", "Alice" }; char lnames[][12] = { "Hope", "O'Connor", "Danson", "Springs" }; // display names for (i=0; isungetc() != -1 && cin.get() != '\n') cin.ignore(80,'\n'); cout << "Press enter to continue..."; cin.get(); } /* Sample output: Hope Bob O'Connor Carol Danson Ted Springs Alice */