Thread: Display input(password) as asterisk(*)

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    2

    Display input(password) as asterisk(*)

    nevermind
    Last edited by seePLUSPLUSn00b; 09-29-2008 at 01:00 PM.

  2. #2
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    No real standard way to do it but include <conio.h> and use getch() in a while loop. Getch reads the keyboard input in a character-by-character method.

  3. #3
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Quote Originally Posted by seePLUSPLUSn00b View Post
    Can anyone help me by writing a code that would do this and an explanation for what each part of the code does/means? I need to be able to explain how to do it or how it works.
    Now they want us to do the work and explain how it works for them. The laziness meter is off the charts.
    Woop?

  4. #4
    Registered User
    Join Date
    Sep 2008
    Posts
    2
    Quote Originally Posted by prog-bman View Post
    Now they want us to do the work and explain how it works for them. The laziness meter is off the charts.
    Well I said any help is greatly appreciated. If you can write the code or direct me to it or explain how to do this that would help.
    So if you can do either of those things that would be great.

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    The problem is that, as twomers noted, the standard library facilities provide no way of doing what you want to do. <iomanip> will be of no use here. Consequently, your best bet with something simple is the non-standard getch() from the non-standard <conio.h> header.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    This has also been solved loads of times here, so search the forums and you'll find something.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. display character size...(quite urgent..)
    By karthi in forum C Programming
    Replies: 10
    Last Post: 07-11-2007, 09:42 PM
  2. new problem with class
    By jrb47 in forum C++ Programming
    Replies: 0
    Last Post: 12-01-2006, 08:39 AM
  3. about scan 7-segment display via parallel port
    By mobdawg in forum C Programming
    Replies: 4
    Last Post: 09-11-2002, 06:11 AM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. Printf to display chars
    By CodeMonkey in forum C++ Programming
    Replies: 4
    Last Post: 03-14-2002, 05:01 PM