-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
46 lines (29 loc) · 810 Bytes
/
Copy pathtest.cpp
File metadata and controls
46 lines (29 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "passenger.h"
vector<passengerNode> read(string infile);
int main() {
string inFile;
cout << "input file name: ";
cin >> inFile;
vector<passengerNode> data = read(inFile);
passengerHash passengerTable(23);
passengerTable.insert(data);
passengerTable.output(data);
return 0;
}
vector <passengerNode> read(string inFile){
int counter = 0;
ifstream input_from_file(inFile);
cout << endl << "-------------------------------------------- " << endl;
string line;
vector <passengerNode> data ;
while (getline(input_from_file, line)) {
line += ",";
stringstream ss(line);
string word;
while (getline(ss, word)){
passengerNode *passenger = new passengerNode(word);
data.push_back(word);
}
}
return data;
}