Sign-up code

Hello everyone. This is login program, but all what's left is I have to create sign-up code - where for example I create text document where I all the sign up information and login is stored.

How do I create it?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <string>

using namespace std;

int main(){


      string username = "";
      string password = "";
      bool loginSuccess = false;

      cout << "\tWelcome! Pease login below.\n\n";

      do{
       cout << "Username:  ";
       cin >> username;
       cout << "Password:  ";
       cin >> password;

       if(username == "deez" && password == "nutz"){
        cout << "\nSuccessful Login\n\n";
        loginSuccess = true;
       }
       else{
        cout << "Inccorrect username password combo \n";
        cout << "Please try to login again.\n";
         }

     }while(!loginSuccess);

   return 0;
}
If you want to create a file then look at fstream.h header.
http://www.cplusplus.com/reference/fstream/fstream/
Topic archived. No new replies allowed.