So I have a file that I'm reading from that follows a format:
Joe Steve 101
Bob Jeff 231
Ashley Sam 294
Mandy Jill 12
Roger Tong 9395
I want to put each name into an array (or list, vector, whatever) so that only one of each name exists (i.e. No duplicates of any names allowed in the container). Also, the number at the end is irrelevant to organizing the data, but the number is something I have to deal with. How can I accomplish this? Right now, I have the following:
1 2 3 4 5
int main(){
string filename = "someFile.txt";
ifstream fin(filename);
RouteMap theMap(fin); // passes the file to my constructor
}
1 2 3 4 5 6 7 8
RouteMap(){
char city[MAX_CITIES];
while(!sin.eof()){
sin.getline(city,MAX_CITIES); // I get one line from the file
}
}