Thread: Password replace with * on entry

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    1

    Password replace with * on entry

    Hi,
    I'm trying to write a code that on cin of a password it must not show the exact password but type the symbol *..

    I'm trying to look for a function that can replace the entry on input with a symbol *

    please help

  2. #2
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    Not possible with standard C++. This has been asked million times already. Use the search function.

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    85
    You can use getchar() to that effect though

    http://www.cplusplus.com/reference/c...o/getchar.html

    Using the example code from that website, before the line
    Code:
    putchar (c);
    put
    Code:
    c = '*';

  4. #4
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    This question seems vaguely familiar... Perhaps if there were some means by which to traverse the forums to possibly find a question that may have been previously asked...

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Last edited by EVOEx; 11-13-2008 at 04:12 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Input a password and replace with *s
    By Abda92 in forum C Programming
    Replies: 45
    Last Post: 10-06-2007, 03:52 PM
  2. [Q]Hide Password
    By Yuri in forum C++ Programming
    Replies: 14
    Last Post: 03-02-2006, 03:42 AM
  3. Replace a list with a new entry?
    By niponki in forum C Programming
    Replies: 4
    Last Post: 08-17-2005, 10:41 AM
  4. Binary Search Tree
    By penance in forum C Programming
    Replies: 4
    Last Post: 08-05-2005, 05:35 PM
  5. written command line password generator
    By lepricaun in forum C Programming
    Replies: 15
    Last Post: 08-17-2004, 08:42 PM