more specific clear screen

This is a discussion on more specific clear screen within the C++ Programming forums, part of the General Programming Boards category; I am doing an RPG, and it would be nice if when I allowed someone to cin to a variable, ...

  1. #1
    UniqueuserName
    Guest

    more specific clear screen

    I am doing an RPG, and it would be nice if when I allowed someone to cin to a variable, if I could have that number or letter not be displayed to the screen, either by not having it printed to the screen to begin with, or by doing a clear character, or something of the sort.

    Anyone know how?

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Its unbuffer input you want, you'll need a compiler/OS specific function. Maybe you have getch().
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User Pioneer's Avatar
    Join Date
    Dec 2002
    Posts
    59
    Use getch if you have it.
    Code:
    #include <stdio.h>
    #include <conio.h>
    
    main(){
        int key;
    
        printf("Hit a key: ");
        key=getch();
        printf("\nYou hit %c\n", key);
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting a clear screen...
    By Finchie_88 in forum C++ Programming
    Replies: 13
    Last Post: 09-03-2004, 06:38 PM
  2. Dev C++ Clear Screen
    By MiLo in forum C Programming
    Replies: 21
    Last Post: 07-01-2004, 05:06 PM
  3. Clear Screen Again!!!
    By trang in forum C Programming
    Replies: 3
    Last Post: 12-13-2003, 08:36 AM
  4. Yet another clear screen thread :D
    By kermit in forum Linux Programming
    Replies: 2
    Last Post: 11-20-2003, 05:14 AM
  5. How to clear the screen?
    By Zopyrus in forum C++ Programming
    Replies: 8
    Last Post: 11-07-2003, 10:20 PM

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