Input Masks - PASSWORDS

This is a discussion on Input Masks - PASSWORDS within the C++ Programming forums, part of the General Programming Boards category; I am trying to create a input mask for a password. You know how you always see the letters you ...

  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    2

    Input Masks - PASSWORDS

    I am trying to create a input mask for a password. You know how you always see the letters you are typing...how do I change these to astericks. I know there has to be a way, I just can't seem to find it. This is in the Win32 screen, otherwise I would know how to do it. Any help would be greatly appreciated. Thank you.

  2. #2
    unleashed alphaoide's Avatar
    Join Date
    Sep 2003
    Posts
    696
    source: compsci textbooks, cboard.cprogramming.com, world wide web, common sense

  3. #3
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    getch()

    (Both getch() and getche() are non-standard: )
    Code:
    #include <conio.h>  // non-standard
    getch();  // Get character.  Don't "echo" to screen.
    getche()  // Get character.  Echo to screen
    Any techniques you use will be non-standard and non-portable (specific to your compiler/platform).

    As far as I know, the C++ language standard "expects" all input to be displayed on the screen.

    It does not require that any input be recognized by your program before hitting ENTER.

    And, although you can always backspace, the standard does not require the console to have the capability of over-writing a line after a carrage-return and/or linefeed. (There is no gotoxy() in the standard.)

    Now, true Win32 applications don't use <iostream>, <stdio>, or <conio>. You capture the keyboard "messages" in your Windows Processing Loop, and you can do whatever you want with the keyboard input!
    Last edited by DougDbug; 02-20-2004 at 01:16 PM.

  4. #4
    Registered User
    Join Date
    Feb 2004
    Posts
    2

    Thank you

    Thank you so much!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Input statement problem
    By une in forum C Programming
    Replies: 3
    Last Post: 05-30-2007, 12:16 AM
  2. For loop problems, input please.
    By xIcyx in forum C Programming
    Replies: 2
    Last Post: 04-22-2007, 04:54 AM
  3. I would love some input on my BST tree.
    By StevenGarcia in forum C++ Programming
    Replies: 4
    Last Post: 01-15-2007, 01:22 AM
  4. Simple Console Input for Beginners
    By jlou in forum C++ Programming
    Replies: 0
    Last Post: 06-21-2005, 02:50 PM
  5. Stupid Question
    By digdug4life in forum C++ Programming
    Replies: 22
    Last Post: 05-17-2005, 12:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21