int main() { LL list; fstream fileobject("C:\\Users\\Jonathan\\output.txt"); // open a filestream string file; while (fileobject >> file) { //cout << file << endl; list.addLine(file); } fileobject.close(); for (short i = 0; i < 43; i++) { cout << list.getText() << endl; cout << endl; } system("Pause"); return 0; }
int main() { LL list; ifstream fileobject("C:\\Users\\Jonathan\\Documents\\states.txt"); // open a filestream (this path needs to be modified each time.. sorry) string file; while (getline(fileobject, file)) //loop through the text file and grab each line { list.addLine(file); //add the text to the node and then print using the .getText() function cout << list.getText() << endl << endl; } fileobject.close(); system("Pause"); return 0; }