
August 15th, 2006, 10:02 AM
|
|
Contributing User
|
|
Join Date: Jan 2005
Posts: 600

Time spent in forums: 2 Days 22 h 40 m 27 sec
Reputation Power: 4
|
|
|
Ask for the user to input a username and password (using the console standard iostream input methods) and then compare the pair to either something hardcoded or a user-list file somewhere (that could be encrypted for security). Then, if the user entered an invalid username/password, return from main right there and end the program. Simple.
P.S. This becomes much less simple when you bring encryption into the mix.
P.P.S. Please don't come back and ask how to make *** display when the user types the password. It can't be done with standard C++; it will require a compiler- and/or OS-specific extension (such as ncurses for linux).
|