//Reads a set of names into a 2-D array and examines the individual elements of one name // and prints out all the names. Notice how we reference a string versus a single element // of the array. #include using namespace std; int main() { const int numNames = 4; char names[numNames][50]; // array of names int i; for (i = 0; i < numNames; i++) //read in 10 names { cout << " Please enter one name (first and last)" << endl; cin.getline(names[i],50); } // let's look at the individual elements of the 1st name i = 0; while (names[0][i] !='\0') { cout << "element " << i << ": " << names[0][i] << endl; i++; } //now let's list all the names for (i = 0; i < numNames; i++) cout << names[i] << endl; return 0; }