Results 1 to 3 of 3

Thread: ********* output

  1. #1
    Guest

    Post

    How do i make the output appear like this "*******" when someones entering a string?

  2. #2
    Guest
    No one has any ideas?

  3. #3
    Lively Member
    Join Date
    Jul 2000
    Posts
    94
    If this is for a Windows console app you can use _getch to get a character at a time with no echo to the screen. You can then output a * for each character read until enter is pressed.

    Code:
    char ch;
    do{
       ch = _getch();
       cout << "*";
    }
    while(ch != 13);
    NOTE: this code is off the top of my head and has not been tested at all! I don't know which library _getch is in. You will need to look it up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width