Hello im not quite understanding why my code wont generate the correct output that i need.
My question is:
Write a program that opens a (text) file, and displays the contents of that file one line at a time. After a line has been displayed, the program should wait for the user to press the key before displaying the next line in the file.
Now when i run and compile my program it just displays everything all at once.. Any suggestions?
using namespace std;
ifstream file("input.txt"); // File name goes here
cout << line + "\n";
See maybe my issue might be that i was using the compile online website. I seem to have issues tho with using Xcode on my mac when i try and save text file in the programs derived data alias it doesnt open it up like it should in the main program...