hi please help me make a username with number .. im using stdio conio ctype and string as include thanks in advance

What do you mean by having a username made of numbers? Do you want a text username that gets encrypted into numbers?

a username that combines number like nhez12 and password like nhez12 like that

Well you can use the string type. The string type can hold pretty much every character that is on the standard us keyboard.

#include <string>
#include <iostream>

using namespace std;

int main()
{
    string username, password;
    cout << "Please enter a username: ";
    cin >> username;
    cout << "Please enter a password: ":
    cin >> password;
    cin.ignore(80, '\n');  // clear input buffer

    cout << "Username: " << username << endl;
    cout << "Password: " << password << endl;
    cin.get();  // pause program

    return 0;
}

If you know hashing, you can create a simple hash function which takes username and some "key", hashes them to give you a unique password for that username. Here is a nice tutorial on hashing.

Edited 4 Years Ago by np complete

nathan can you put code that it will loop for 5 times? because my prof requirements is
1. max of 15 char
2. only 5 tries loop
3. and 5 login tries
thank you

Edited 4 Years Ago by nheziscute22: lack of info

The code I posted will run on a standard conforming complier but turbo c++ is not standard. We do not do your homework for you. You come up with the code and we will help you fix it.

This article has been dead for over six months. Start a new discussion instead.