Xcode C++ help! Replacing input as it is recieved

Discussion in 'Mac Programming' started by unknown.exe, Dec 13, 2007.

  1. unknown.exe macrumors member

    unknown.exe

    Joined:
    Sep 22, 2007
    Location:
    Somewhere on Earth
    #1
    Sup, I'm writing a C++ program that requires you to input a password before giving the user access to the full program. My question is, how can I replace the input with asteriks while the user is typing, like login screens on computers. I've heard about echo and other things like that, but nobody is being very specific with their answer... I've only been programming C++ for 12 weeks. So can anyone tell me in terms that a 9th grader in a C++ class with an incompetent teacher can understand;)?:apple:
     
  2. unknown.exe thread starter macrumors member

    unknown.exe

    Joined:
    Sep 22, 2007
    Location:
    Somewhere on Earth
  3. ChrisBrightwell macrumors 68020

    ChrisBrightwell

    Joined:
    Apr 5, 2004
    Location:
    Huntsville, AL
    #3
    Add this to your vocabulary: "functional decomposition"
     
  4. yeroen macrumors 6502a

    yeroen

    Joined:
    Mar 8, 2007
    Location:
    Cambridge, MA
    #4
    Does the password prompt come wrapped in a GUI or is it at the command line?
     
  5. unknown.exe thread starter macrumors member

    unknown.exe

    Joined:
    Sep 22, 2007
    Location:
    Somewhere on Earth
    #5
    guys I'm using pretty basic C++, please don't make it complicated, nut it's in Xccode, not the command line.
     
  6. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #6
    If you are not using a GUI then you are, by default, using the command line to execute your program.
     
  7. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #7
    First off, you shouldn't make a new thread for this when you already have an existing thread.

    Second, when was the last time you saw at the command line your password being replaced with asterisks? AFAIK, passwords entered in the terminal are never shown (e.g. sudo) if using the appropriate calls. Passwords entered in the GUI are replaced with asterisks. This is the standard behavior I've seen, and the answer for doing this has already been given.
     
  8. ChrisBrightwell macrumors 68020

    ChrisBrightwell

    Joined:
    Apr 5, 2004
    Location:
    Huntsville, AL
    #8
    I always saw it in the hacker flicks and thought it would be awesome to have the asterisks pop up when I type my password at the CLI.
     
  9. pilotError macrumors 68020

    pilotError

    Joined:
    Apr 12, 2006
    Location:
    Long Island
    #9

Share This Page