Thread: clear screen.. is this the right way

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User Kurisu's Avatar
    Join Date
    Feb 2006
    Posts
    62
    I'm sure some kind of sleep function of sorts is probably provided for use with Milliseconds as the parameter I bet.. though I'm too lazy to look it up to verify.

    Pointless side note: Maybe its just me, but infinite loops look better with a while statement rather than a for .. eh maybe I'm the only one.
    Last edited by Kurisu; 06-06-2006 at 12:58 AM.

  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    9

    good method

    Code:
    system("cls");
    
    Advantages:       None really.
    
    Disadvantages:  Spawns a process to do the dirty work for you.
    It's bad for security reasons. 
    For example, someone could map cls to another program, and yours would run it without realising.
    I use system("cls") and it seems to work perfectly.
    Does the word "someone" or a program that is
    already existing on your computer?
    Even so, what could be so bad about the system clearing the screen on accident?

  3. #3
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    I believe the bad thing is when you accidentally download some virus that calls itself cls.exe. You come along and have this (unnecessary and annoying to many experienced users) attempt to clear the screen, but instead start this virus and hell ensues...

    Or something like that.
    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.*

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, 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, 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