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

  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
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    FAQ > Clear the screen? - Cprogramming.com


    system() isn't evil in any way...but it makes the program dependent on the shell.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    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
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    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 ?)

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    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
    4,633
    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, 03: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, 09:47 PM
  4. FAQ Clear screen command (C)
    By Pain2k in forum FAQ Board
    Replies: 7
    Last Post: 11-05-2001, 05:43 AM
  5. Clear screen command
    By Pain2k in forum C Programming
    Replies: 6
    Last Post: 11-01-2001, 09:15 PM