Hello DaniWeb,
This is my first real assignment and am having problem with it. The program must accept a userID and pass from user. The program must also read the userID and pass from file and if it matches the one on file, the program must display success message.
The data file consists of this: "user@name.com pass" sans quotes.
So far, I know I have to take into account the white space in the middle and need two strings for it. I've gone this far but no clue how to proceed.
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main ()
{
// Reading user and pass from data file
ifstream datafile("lab1.data") // name of data file
dataFIle >> str; // I have no idea how to take two strings from the file here with the white space char in // the middle
Help please!