Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,386 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,118 people online right now. Registration is fast and FREE... Join Now!




password question

 
Reply to this topicStart new topic

password question

potser123
24 Oct, 2006 - 09:19 AM
Post #1

New D.I.C Head
*

Joined: 4 Oct, 2006
Posts: 2


My Contributions
hi, i already know how to create a password in C using getch() but i have a problem

when the user presses backspace it still prints *

is there a way to avoid this?
User is offlineProfile CardPM
+Quote Post

UMTopSpinC7
RE: Password Question
24 Oct, 2006 - 02:08 PM
Post #2

New D.I.C Head
*

Joined: 20 Oct, 2006
Posts: 47


My Contributions
Can't you just check to see if the ascii value of the char entered is 8 (Backspace) and then tell it not to print out a *. I'm not sure what exactly you are doing so that is all i can help.

QUOTE(potser123 @ 24 Oct, 2006 - 10:19 AM) *

hi, i already know how to create a password in C using getch() but i have a problem

when the user presses backspace it still prints *

is there a way to avoid this?

User is offlineProfile CardPM
+Quote Post

Antiokus
RE: Password Question
24 Oct, 2006 - 02:19 PM
Post #3

D.I.C Head
**

Joined: 6 Sep, 2006
Posts: 127



Thanked: 1 times
My Contributions
TopSpin is correct. Although Im familiar with passwords in C, you may have to test for the backsapce. Although, there may be another way.

You may just check the ascii value of the character and if its 8 then instead of adding an *, delete one. But thats just me and I really bet there is a better way to do it.

Now that I think about it, you may want to set it up that if they hit backspace, then just make them redo it. Helps with security I guess although it can be a hassle. Just a thought.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 02:05AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month