C++ password

How to display a password through stars

Page 1 of 1

1 Replies - 2086 Views - Last Post: 19 December 2010 - 08:17 PM Rate Topic: -----

#1 Reeza777  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-December 10

C++ password

Posted 19 December 2010 - 08:05 PM

Actually I am a student yet so I am learning C++ and I have interested about this computer language. And also I am doing a air line reservation system because i have to do that to our assignment and so .. I want to know for that log in screen If a user want to enter first they have to enter their password so I want to display that password which enters by user through the stars.. If anybody know then please will share your knowledge with me .
Is This A Good Question/Topic? 0
  • +

Replies To: C++ password

#2 OnlineCop  Icon User is offline

  • D.I.C Head

Reputation: 19
  • View blog
  • Posts: 73
  • Joined: 16-April 10

Re: C++ password

Posted 19 December 2010 - 08:17 PM

You will scan for a keypress. Instead of printing it to the output, evaluate the key press.

If it is alphanumeric, print a '*' and add that character to your password's string buffer.
If it is the BACKSPACE key, remove one of characters from the '*' field and one character from the password's string buffer.
If it is the ENTER key, submit the entire password already in the password's string buffer as the password.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1