I am totally stuck. I created a program to read in the file and one that will sort from a string array. The problem is that it sorts from the beginning of each line. I need it to sort after the -. I need it to sort by the town not the name. How do I do this? Everything works up to this point.
#include <iostream>
#include <string>
using namespace std;
void sort(string ar[],int n){
}
int main()
{
int i;
string town[] = { "",
"Joshua Lynn Odom - Bates Town",
"Cindy Blue - Broken Arrow",
"Donnie Kay - Oklahoma City",
"Billy Bob - Durant",
"Randall John - Lawton",
"Tammy Smiley - Ada",
"Danny Steven Ray - George Town",
"Rodney White - Lone Grove",
};
int N = sizeof(town)/sizeof(town[0]);
sort(town,town+N);
cout << "SORTED TOWNS" << endl;
for (i=0; i < N; i++)
cout << town[i] << " " << endl;
cout << endl << endl;
}