Clearing the screen

This is a discussion on Clearing the screen within the C Programming forums, part of the General Programming Boards category; Is there a C command to clear the screen, like the DOS "CLS"?...

  1. #1
    Polar Fuzz
    Join Date
    Oct 2003
    Posts
    36

    Clearing the screen

    Is there a C command to clear the screen, like the DOS "CLS"?

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    FAQ
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    45

    reply

    if u are in unix envirenment u can try the following

    Code:
    system("clear");
    or include the file curses.h and u can use the function clear(); to clear the screen

    under DOS u can use clrscr(); or system("cls"); to achieve the same.

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>system("clear");
    And the FAQ explains just why you shouldn't do that.
    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. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 04:56 PM
  2. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM
  3. clearing the screen
    By ssharish in forum C Programming
    Replies: 2
    Last Post: 02-01-2005, 09:00 PM
  4. 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
  5. Clearing the screen
    By Shadow in forum C Programming
    Replies: 4
    Last Post: 05-23-2002, 02:40 PM

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