Register and Login Program

Hey, so i wanted to know just the basics of making a register, then login program.

I know things like:

int choice; for choice 1 or 2 or 3

1 - Register
2 - Login
3 - Exit

and cout/cin or printf and scanf.

i just want to know how I would set it out..
Last edited on
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
34
#include <iostream>
#include <Windows.h>
#include <string>

using namespace std;

int choice;
string password;
string username;



int main()
{
	cout << "Hello, Would you like to: \n\n"
		<< "1 - Register\n"
		<< "2 - Login\n"
		<< "3 - Exit\n\n"
		<< endl;
	cout << "Now choose: ";
	cin >> choice;

	if (choice == 1)
	{
		cout << "Please choose a username: ";
		cin >> username;
		cout << "Now choose a password: ";
		cin >> password;
		
	}

	system("pause");
	return 0;
}


is what i have so far, can someone please tell me how to make it ask if you are sure you want to make an account then go back to the register / login / exit page?

also is it better to use cases?
Last edited on
Topic archived. No new replies allowed.