colours & clear screen

This is a discussion on colours & clear screen within the Linux Programming forums, part of the Platform Specific Boards category; can somebody write a little example program, how can i clear screen (like CLS in dos) and use colours in ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    2

    colours & clear screen

    can somebody write a little example program, how can i clear screen (like CLS in dos) and use colours in text in Linux console (without conio.h)

    thanks.
    (yes, i canīt speak english well )

  2. #2
    Registered User Dr. Bebop's Avatar
    Join Date
    Sep 2002
    Posts
    96
    Why not just use curses? It's a lot easier to read.
    Code:
    #include <curses.h>
    
    void clrscr()
    {
            initscr();
            clear();
            endwin();
    }
    Processing error: Stupidity detected.
    ------------------------------
    Dr. Bebop
    Windows XP Professional Ed.
    Microsoft Visual Studio 6

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    202
    If you don't care about platform independence, and just want to know the quick and dirty way to clear the screen, make a call to

    system("clear");

    at the point where you want the program to clear the screen.

    starX
    www.axisoftime.com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 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, 02:41 AM
  2. Getting a clear screen...
    By Finchie_88 in forum C++ Programming
    Replies: 13
    Last Post: 09-03-2004, 05:38 PM
  3. Clear Screen Again!!!
    By trang in forum C Programming
    Replies: 3
    Last Post: 12-13-2003, 07:36 AM
  4. Yet another clear screen thread :D
    By kermit in forum Linux Programming
    Replies: 2
    Last Post: 11-20-2003, 04:14 AM
  5. How do I clear screen in a C program?
    By DarkboyBlue in forum C Programming
    Replies: 6
    Last Post: 08-21-2002, 11:26 AM

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