clear screen

This is a discussion on clear screen within the C++ Programming forums, part of the General Programming Boards category; is there a way to clear screen?...

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    142

    clear screen

    is there a way to clear screen?
    WhAtHA hell Is GoInG ON

  2. #2
    Registered User SKeane's Avatar
    Join Date
    Sep 2006
    Location
    England
    Posts
    234
    Read the FAQs

  3. #3
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,479
    Sevral. Based on your compiler.
    There is an FAQ in this.

    Borland uses clrscr()

    Most go with system("cls") althougth the FAQ does say this is a lazy mans way to get the OS to do it for you.
    I'm just trying to be a better person - My Name Is Earl

  4. #4
    MFC killed my cat! manutd's Avatar
    Join Date
    Sep 2006
    Location
    Boston, Massachusetts
    Posts
    870
    Not to mention it's slow.
    Silence is better than unmeaning words.
    - Pythagoras
    My blog

  5. #5
    For Narnia! Sentral's Avatar
    Join Date
    May 2005
    Location
    Narnia
    Posts
    719
    I don't find this technically clearing the screen, but it's in the FAQ...meh:
    Code:
     Write newline characters until everything has scrolled off of the screen:
    
    #include <stdio.h>
    
    #define SCREEN_HEIGHT 25
    
    int main ( void )
    {
      int i;
      
      for ( i = 0; i < SCREEN_HEIGHT; i++ )
        putchar ( '\n' );
        
      return 0;
    }
    Videogame Memories!
    A site dedicated to keeping videogame memories alive!

    http://www.videogamememories.com/
    Share your experiences with us now!

    "We will game forever!"

  6. #6
    Registered User
    Join Date
    Dec 2006
    Location
    Scranton, Pa
    Posts
    252
    I don't have clrscr() available, so I'll stick with system ("cls"). The other methods appear to be nothing more than convoluted attempts to complicate matters.

  7. #7
    For Narnia! Sentral's Avatar
    Join Date
    May 2005
    Location
    Narnia
    Posts
    719
    You don't have it because your compiler doesn't support it. I agree, the methods in the FAQ are...hmm...crap...not to mention confusing for beginners.

    Take the advice from swgh, and use any of those two commands. They are probably the best ways to clear the screen. Remember KISS (Keep It Simple Stupid), even if it is "lazy", use what you got at hand.
    Videogame Memories!
    A site dedicated to keeping videogame memories alive!

    http://www.videogamememories.com/
    Share your experiences with us now!

    "We will game forever!"

  8. #8
    Registered User
    Join Date
    Dec 2006
    Posts
    12
    are you using borland c++?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. CLear Screen Routine
    By AQWst in forum C++ Programming
    Replies: 4
    Last Post: 12-13-2004, 08:24 PM
  2. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 03:41 AM
  3. Getting a clear screen...
    By Finchie_88 in forum C++ Programming
    Replies: 13
    Last Post: 09-03-2004, 06:38 PM
  4. Clear Screen Again!!!
    By trang in forum C Programming
    Replies: 3
    Last Post: 12-13-2003, 08:36 AM
  5. Yet another clear screen thread :D
    By kermit in forum Linux Programming
    Replies: 2
    Last Post: 11-20-2003, 05:14 AM

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