Clear the Console Screen

This is a discussion on Clear the Console Screen within the C++ Programming forums, part of the General Programming Boards category; I have forgotten where I found this... but it is a header file to use the clrscr() function in C++. ...

  1. #1
    Registered User Gnoober's Avatar
    Join Date
    Oct 2002
    Posts
    40

    Talking Clear the Console Screen

    I have forgotten where I found this... but it is a header file to use the clrscr() function in C++. Just save the file into you compiler's "include" folder and when you want to clear the screen type
    Code:
    #include <clrscr.h>
    
    clrscr();
    The header file "clrscr.h" is attached.
    Attached Files Attached Files
    - Grady (:

  2. #2
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    doesn't stndlib.h have the same thing?
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

  3. #3
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    its in conio.h aswell
    Monday - what a way to spend a seventh of your life

  4. #4
    Seven years? civix's Avatar
    Join Date
    Jul 2002
    Posts
    605
    Console clearscreen functions can be found in the following header files:

    stdlib.h
    conio.h

    stdlib clearscreen function:
    Code:
    system("CLS");
    conio clearscreen function:
    Code:
    //for dev-C++, load conio.o
    
    clrscr();
    I hope I helped some lost soul out there

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    but it is a header file to use the clrscr() function in C++. Just save the file into you compiler's "include" folder and when you want to clear the screen type
    - Function bodies don't go in header files.
    - The clrscr() function conflicts with the one on my compiler thats already in conio.h that has been #include'd by this code. OK, so not everyone is going to have a clrscr() in their conio.h, but maybe I'd suggest a less common name.
    - Before any newbie tries it, I'd point out the fact this is Windows specific code (I'm sure that's obvious, but you never know...)
    - ... and oh no... not another clear the screen thread ....
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Clear Screen Again!!!
    By trang in forum C Programming
    Replies: 3
    Last Post: 12-13-2003, 08:36 AM
  2. Yet another clear screen thread :D
    By kermit in forum Linux Programming
    Replies: 2
    Last Post: 11-20-2003, 05:14 AM
  3. How to clear the screen?
    By Zopyrus in forum C++ Programming
    Replies: 8
    Last Post: 11-07-2003, 10:20 PM
  4. Clear Screen
    By KneeGrow in forum C++ Programming
    Replies: 1
    Last Post: 10-24-2003, 11:17 PM
  5. Console Screen Buffer
    By GaPe in forum Windows Programming
    Replies: 0
    Last Post: 02-06-2003, 05:15 AM

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