Thread: clear screen function

  1. #16
    Quote Originally Posted by SpudNuts
    Code:
    system("cls");
    Can that be placed anywhere within your code?
    Technically, yes, but it would be a serious coding mistake, from the maintenance point of view. Not portable things should be abstracted so that they are defined only once.

    Maintenance hell:
    Code:
    system("cls");
    <...>
    system("cls");
    <...>
    system("cls");
    <...>
    system("cls");
    Maintenance heaven:
    Code:
    void cls(void)
    {
       system("cls");
    }
    
    <...>
    cls();
    <...>
    cls();
    <...>
    cls();
    <...>
    cls();
    See the difference ?
    Emmanuel Delahaye

    "C is a sharp tool"

  2. #17
    Registered User
    Join Date
    Dec 2004
    Location
    Oklahoma City
    Posts
    55
    Gotcha, thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 08:56 AM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Clear Screen Function?
    By Punkture in forum C Programming
    Replies: 3
    Last Post: 05-05-2003, 09:25 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM