I am making a beginner project in C++ "Login and Registration System", now when I was writing the Login(); function I got stuck as I was not able to read the data I stored in the data.txt file in the registration(); function.
void login() {
string username, password, info;
cout << "\t\t\t\t\t\t\Login System" << endl << "\t\t\t\t\tEnter Username:";
cin >> username;
cout << "\t\t\t\t\tEnter Password:";
cin >> password;
ifstream data;
data.open("data.txt");
while (data) {
getline(data, info);
}
}
Here, this is an error of 'identifier "getline" is unidentified'. I'm using Visual Studio, how can I fix this?