Re: clrscr Compiler Independent functions

Discussion in 'C++' started by Dfschweiss, Dec 1, 2004.

  1. Dfschweiss

    Dfschweiss Guest

    For clrscr() you can use the macro
    #define clrscr() (system("CLS"))

    system() is in stdlib.h

    Clearing the console screen is actually a bad habit, many users don't want
    their screen information wiped out by your presumptuous program!

    A lot of compilers accept getchar() or cin.get() to wait.

    getchar() is in stdio.h
    Dfschweiss, Dec 1, 2004
    #1
    1. Advertising

  2. (Dfschweiss) wrote in message news:<>...
    > For clrscr() you can use the macro
    > #define clrscr() (system("CLS"))


    you could try, but on a unix system that may very well give you a
    colored listing of directory contents. I know my cls did that.

    > system() is in stdlib.h
    >
    > Clearing the console screen is actually a bad habit, many users don't want
    > their screen information wiped out by your presumptuous program!


    True, and if the output is redirected to a file ( typically exe >>OUT.TXT)
    that file won't be wiped anyway.


    HTH,
    Michiel Salters
    Michiel Salters, Dec 1, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AHR

    Problem with clrscr()

    AHR, Jan 26, 2004, in forum: C++
    Replies:
    3
    Views:
    8,521
    ensvhiiotus_17
    Aug 7, 2008
  2. Jonathan Mcdougall

    Re: clrscr Compiler Independent functions

    Jonathan Mcdougall, Nov 23, 2004, in forum: C++
    Replies:
    0
    Views:
    352
    Jonathan Mcdougall
    Nov 23, 2004
  3. Michele 'xjp'

    POSIX and getch(), clrscr()

    Michele 'xjp', Jul 20, 2007, in forum: C++
    Replies:
    8
    Views:
    1,365
    Thomas Dickey
    Jul 27, 2007
  4. Replies:
    1
    Views:
    730
  5. vikaskumar sharma

    How to clear screen (as clrscr in c) in java?

    vikaskumar sharma, Oct 6, 2012, in forum: Java
    Replies:
    9
    Views:
    1,600
    Knute Johnson
    Oct 7, 2012
Loading...

Share This Page