I'm making a program where you can login and register. All the data is stored in a .txt file. The problem that I currently have is that when I try to get all the data from the file, I only get the first line/string of the file. I want to get everything in the .txt. Here is some code:
What's in the .txt:
hello:world
foo:bar
usr:pass
Code (as a test):
ifstream check;
check.open("UsrInfo.txt");
string dataStr;
getline(check, dataStr);
cout << dataStr;
cout << endl;
Output:
hello:world
What I want the output to be:
hello:world
foo:bar
usr:pass
What can I do to fix this? Thanks!