-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSource.cpp
More file actions
76 lines (59 loc) · 1.32 KB
/
Copy pathSource.cpp
File metadata and controls
76 lines (59 loc) · 1.32 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <iostream>
#include <fstream>
#include <string>
#include "Node.h"
#include "LinkedList.h"
#include "Composer.h"
using namespace std;
int main() {
//LinkedList<int> obj1;
//cout << boolalpha;
//cout << obj1.isEmpty() << endl;
//obj1.insert(35);
//obj1.insert(15);
//obj1.insert(67);
//obj1.insert(69);
//obj1.append(1);
//obj1.append(55);
//obj1.prepend(23333333);
//obj1.removeFront();
//obj1.insert(54);
//obj1.printList();
//cout << obj1.isEmpty() << endl;
//cout << obj1.getFirst() << endl;
//cout << obj1.getLast() << endl;
//cout << boolalpha;
//cout << obj1.find(55) << endl;
//cout << obj1.find(3) << endl;
/*Composer temp ,temp2;
bool loop = true;
temp.createLinkedList(temp2);
*/
LinkedList<Composer> obj2;
ifstream inFile;
inFile.open("composers.txt");
if (!inFile) {
cout << "Error opening the file" << endl;
}
else {
string compName;
string temp;
int compYear;
Composer tmp;
Node<Composer>* objFirst;
while (!inFile.eof()) {
getline(inFile, compName, ',');
inFile.ignore();
getline(inFile, temp);
compYear = stoi(temp);
tmp.name = compName;
tmp.year = compYear;
/*if (counter == 1) {
objFirst = &obj;
}*/
obj2.insert(tmp);
}
}
obj2.printList();
return 0;
}