-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRandom_Data.cpp
More file actions
41 lines (36 loc) · 852 Bytes
/
Copy pathRandom_Data.cpp
File metadata and controls
41 lines (36 loc) · 852 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
#include <iostream>
#include <fstream>
#include <vector>
#include <iterator>
#include <string>
using namespace std;
class CSVReader {
string fileName;
public:
CSVReader(string filename){
fileName = filename;
}
vector<string> getData();
};
vector<string> CSVReader::getData() {
ifstream file(fileName);
vector<string> dataList;
string line = "";
while (getline(file, line)){
dataList.push_back(line);
}
file.close();
return dataList;
}
int main() {
CSVReader reader("/Users/rachelfenton/Desktop/Names.txt");
vector<string> names = reader.getData();
for(string vec : names){
cout << vec << endl;
}
//vector<User> userList;
for (int i = 0; i < 100000; i++){
//make a user oject with ID = i, name = names[random # from 1-10,000]
}
return 0;
}