can the word enter in dos be masked?

This is a discussion on can the word enter in dos be masked? within the C++ Programming forums, part of the General Programming Boards category; i would like to enter password in the program, can i mask the password i entered with "*"s?? thanks for ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    can the word entered be masked?

    i would like to enter password in the program, can i mask the password i entered with "*"s??

    thanks for giving help~

    Code:
    cout << " Please Enter the FTP login id\n";
    cin.getline(login,10);
    cout << " Please Enter the Password \n";
    cin.getline(password,20);
    can the password i entered be masked??
    Last edited by Jasonymk; 01-20-2003 at 12:49 AM.

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    solved

    ~~>.<.....

  3. #3
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    you can do sometin like this.. but the function i am using is not standard and will not work on all platforms and compilers....



    Code:
    # include <iostream.h>
    # include <conio.h>
    
    
    int main()
    {
    
    char username[20];
    char password[20];
    clrscr();
    cout<<"Username > ";
    cin>>username;
    char ch;
    int num=0;
    do{
    ch=getch();
    password[num]=ch;
    cout<<"*";
    
    num++;
    }
    while(ch!=13);
    
    
    
    return 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. seg fault at vectornew
    By tytelizgal in forum C Programming
    Replies: 2
    Last Post: 10-25-2008, 01:22 PM
  2. Underlining a word in DOS?
    By renurv in forum C++ Programming
    Replies: 9
    Last Post: 01-14-2006, 07:05 AM
  3. Find a word in a 2d grid
    By The_Kingpin in forum C++ Programming
    Replies: 2
    Last Post: 02-24-2005, 04:38 PM
  4. Input for Struct?
    By stewade in forum C Programming
    Replies: 26
    Last Post: 05-03-2004, 11:52 AM
  5. real mode dos & win dos
    By scott27349 in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 08-19-2002, 06:15 AM

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