may i suggest u use an vector<string> to put the names in...
in that way u can use eather the sort and find functions from algorithm, or u can make ur own, but it should be much easyer then with dinamic alocation of 2D arrays
We have to use the dynamic array, as set by the "requirements" of our professor for this assignment. At this point, I need the binary search to work, but I am not sure what Name should be compared against since I am not sure how to compare name to another name in my array...
1 2 3 4 5 6 7 8
cout << "Which name do you want to search for? " << endl;
cin >> Name;
BinarySearch (TwoDArray[10]);
if (Name = TwoDArray)
cout << "The index of the string is: " << Name << endl;
else
cout << "The string you seek is missing. " << endl;
first of all, change the if to if(Name==TwoDArray)
and second, try to make just one array that will store the names, and when u search for a name, count how many places the pointer has changed, that counter will give u the index you are searching for.