Clear screen

This is a discussion on Clear screen within the C++ Programming forums, part of the General Programming Boards category; I have a strange question. Is thier a clear screen function iostream.h? I ask this because I'm in a programming ...

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

    Clear screen

    I have a strange question.

    Is thier a clear screen function iostream.h?

    I ask this because I'm in a programming class where the teacher only allows you to use files already loaded on his system, so I can't use conio.h, or any of the other wonderful include files I have come to know and love (I never thought I'd say this, but I miss apstrings.....).

    And what's worse is that I have to program in a stripped down linux compilier so I can't use any of the microsoft files.

    Any ideas?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,499
    Ask your teacher
    a) is clear screen required for completing my assignments?
    b) is there a clear screen function in the environment you provide?

    If the answer to both is "no", then its easiest to forget about it.

    But if you're really desperate

    Code:
    for ( int i = 0 ; i < 30 ; i++ ) cout << endl;
    Is a reasonably portable way of achieving what you want


    Or how about
    Code:
    system("clear");
    Or even
    Code:
    cout << "\033[2J";
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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

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