In this block of code
cout << "Enter Username:";
cin >> userName; // BEING IGNORED
cout << "Enter Password:";
cin >> password; // BEING IGNORED
while (cin >> userName >> password) // THIS IS BEING SAVED>
outFile << userName << password << endl;
You are not writing the first userName
and password
to the output file.
It's not clear whether you wanted to really have the while
loop in there. If you want to write out just the first username and password, you need to change it to:
cout << "Enter Username:";
cin >> userName;
cout << "Enter Password:";
cin >> password;
if (cin)
outFile << userName << password << endl;