How to preapre a C++ Program to login with the password after saving it to the Computer

closed account (jNhkoG1T)
Hi friends,

I am new to C++ programming without having any previous experience in programming in any another language. So guys, please help me out! :(

>> I am going to prepare a C++ program that first takes the
Name, Username and password
(Each character must be replaced by "*" at the same time) from the user.

>> After the everything is taken, the Login page will be displayed to the user where when he/she logins with username and password, it will display "Welcome <Name>" where <Name> will be replaced by the name after the registration.


TO PROPERLY ELABORATE WHATEVER I SAID, HERE'S AN EXAMPLE:

# First Page:-
1
2
3
Enter your name: John Bill
Enter your user name: john12
Enter your password: *******        //E.g. - passkey 


#Second Page:-
1
2
3
4
Enter your username: john12
Enter your password: ********

>> WELCOME JOHN!




Actually I am facing many problems while coding. Even, I am facing problem in the
DATA FILE HANDLING
concepts that will be used in the program.

Please help me friends, and please post the full source code compatible with Turbo C++ either v.3.0 or v.4.5 !

GUYS, PLEASE DON'T FORGET TO WRITE THE FULL SOURCE CODE AS I AM A TOTAL NOVICE IN PROGRAMMING. :P

Your help will be further appreciated!

Thanks, in advance! :)
Last edited on
Replacing input with another character is somewhat dificult in the console world.
Well the you could use the non-standard library conio. Then use some sort of loop getting getting each character entered and appending that to the end of the "password" string and at the same time outputting an asterisk.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
#include <string>
#include <conio.h>

int main()
{
    std::string password( "" );
    char temp;

    std::cout << "Please enter your password -> " << std::flush;
    while( static_cast<int>( temp = getch() ) != 13 )
    {
        password += temp;
        std::cout << '*' << std::flush;
    }

    std::cout << std::endl << "The password entered was: " << password << std::endl;

}
this really looks like an assignment :

Please help me friends, and please post the full source code compatible with Turbo C++!


here's one advice, when you save the credentials file, you should apply some cryptography on the password.
oh I didn't even read his full post or I wouldn't of even posted anything
closed account (jNhkoG1T)
Hey guys, please post the program supported by either Turbo C++ v.3.0 or v.4.5!

In the program written by giblit, the string is unsupported by the Turbo C++ IDE (which supports the original C++, and not the ANSI one). So guys, please post the full code based on whatever I
mentioned above


Your help will be appreciated! :)


Hey guys, please post the program supported by either Turbo C++ v.3.0 or v.4.5!

Why not Cfront?


So guys, please post the full code based on whatever I mentioned above

Nobody is going to post full code for you. This is your assignment. In fact, I doubt anyone will even attempt to assist you if you don't show some effort in the form of code you've generated to attempt to complete the assignment.


GUYS, PLEASE DON'T FORGET TO WRITE THE FULL SOURCE CODE AS I AM A TOTAL NOVICE IN PROGRAMMING. :P

The way we move past the novice stage is to write code. Therefore, write code instead of demanding someone else do it for you.

[Edit: You should note that this question has been answered here and elsewhere. Using a search engine would be advisable.]
Last edited on
Topic archived. No new replies allowed.