invisble help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • halo3isawsome7
    New Member
    • Aug 2008
    • 2

    invisble help

    im trying to make it so when the user inputs a number, it gets input then dissapears so no one else can read it, kind of like a password, im kind of new to c++ so keep the answer as simple ass possible, if you have a function that can do thsi please post! all input is greatly appreciated, thanks.
  • Laharl
    Recognized Expert Contributor
    • Sep 2007
    • 849

    #2
    If this is for a standard console app, look into curses or a similar library for cursor control. Or just use system("cls") or system("clear") , depending on your OS (Windows/*nix, respectively). If this is a GUI application, you should be able to clear a textbox/formfield by setting its text to "".

    Comment

    • halo3isawsome7
      New Member
      • Aug 2008
      • 2

      #3
      Thanks man!! It worked!, I used the system("cls"), but then, untill you press enter, it is still there, so is there a way to make it so when u type it displays as * or just doesnt display at all? please reply and thanks for your help so far.

      Comment

      • Laharl
        Recognized Expert Contributor
        • Sep 2007
        • 849

        #4
        Look into a Windows-compatible curses (or similar cursor control) library (I don't know of one offhand), or there may be a Microsoft function you can use somewhere in the Windows API. I can't be of much help here, I'm afraid, but do some Googling and you never know what will pop up.

        Comment

        • weaknessforcats
          Recognized Expert Expert
          • Mar 2007
          • 9214

          #5
          Research on how to turn the console echo off.

          Comment

          • Billiska
            New Member
            • Aug 2008
            • 13

            #6
            I'm not quite sure if you can use getch() function
            But if you can, this will return a single character without displaying it.
            The function finishes every time you press a key, so you print * just after the function.

            I hope this is helpful.

            Comment

            Working...