How to Clear Screen?? Heard that SYSTEM() is an evil command??

This is a discussion on How to Clear Screen?? Heard that SYSTEM() is an evil command?? within the C++ Programming forums, part of the General Programming Boards category; please help me with a good way to clear the screen.....

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    82

    How to Clear Screen?? Heard that SYSTEM() is an evil command??

    please help me with a good way to clear the screen..

  2. #2
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,498
    FAQ > Clear the screen? - Cprogramming.com


    system() isn't evil in any way...but it makes the program dependent on the shell.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  3. #3
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,765
    system is evil because it isn't portable, is slow, and is a security issue.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,498
    Quote Originally Posted by Elysia View Post
    system is evil because it isn't portable, is slow, and is a security issue.
    But it still remains the easiest way to interact with the shell. When a program is trying to cozy up to a shell, it isn't trying to be portable ..(imho)

    (How is it a security issue ? Won't that make the exec commands bad too ?)
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  5. #5
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,765
    Because something is evil doesn't mean it's useless. If it's useless, it wouldn't be in the standard library.
    Read this for more details: Why system() is evil - C++ Forum
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    May 2010
    Posts
    2,803
    This link has a good in depth look at Clearing the screen along with examples of the good and bad ways to clear the screen.

    Jim

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Is there a clear screen command?
    By Maiq in forum C++ Programming
    Replies: 6
    Last Post: 12-05-2002, 02:48 AM
  2. Clear screen command
    By digarren in forum C++ Programming
    Replies: 10
    Last Post: 10-14-2002, 11:26 PM
  3. Clear screen command?
    By bluehead in forum C++ Programming
    Replies: 2
    Last Post: 11-06-2001, 08:47 PM
  4. FAQ Clear screen command (C)
    By Pain2k in forum FAQ Board
    Replies: 7
    Last Post: 11-05-2001, 04:43 AM
  5. Clear screen command
    By Pain2k in forum C Programming
    Replies: 6
    Last Post: 11-01-2001, 08:15 PM

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