Thread: Screen clear function

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    4

    Screen clear function

    For some reason my header doesn't include my screen clear function please help!!!!!!!!main.cpp

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Clearing the screen is compiler specific. Look in the documentation for your compiler and see if it has one. If it doesn't, write a bunch of newlines until the stuff on the screen goes away.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Aug 2011
    Posts
    4
    I'm using Xcode would u know how to check that????

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You could always try a search engine: xcode clear screen and 10 seconds tells me that it's not yet implemented, and as such, my suggestion for writing out a bunch of newlines is your best bet.


    Quzah.
    Hope is the first step on the road to disappointment.

  5. #5
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by ynf_dude View Post
    I'm using Xcode would u know how to check that????
    Does it not have help files or documentation of some kind?

    Step 1 ... Read the help file!

  6. #6
    Registered User
    Join Date
    Aug 2011
    Posts
    1
    Which screen? Visual C++ is intended for developing Windows
    application, which have windows & dialogs, not screens...

    It can also be used to write console application (like DOS programs),
    where there are several different ways to clear the screen, the easiest of
    which is system("cls");
    Last edited by laserlight; 08-05-2011 at 04:57 AM. Reason: Removing off topic link.

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by johnchristopher View Post
    Which screen? Visual C++ is intended for developing Windows application, which have windows & dialogs, not screens...
    Incorrect. Visual C++ is Microsoft's implementation of the C++ standard, along with their own enhancements (such as MFC).
    It is not intended to be "just" a tool for developing GUI applications. It is a tool to encapsulate the entire C++ language and all of its possibilities.

    It can also be used to write console application (like DOS programs), where there are several different ways to clear the screen, the easiest of which is system("cls");
    Just a note, but this is Windows specific, and it's also a security risk (to use system), and it's slow.
    If you intend to limit yourself to Windows, there are proper APIs to clear the console screen.
    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.

  8. #8
    Registered User
    Join Date
    Aug 2011
    Posts
    4
    Quote Originally Posted by Elysia View Post
    Just a note, but this is Windows specific
    Would you happen to know one that would work for a mac console application??????

  9. #9
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Code:
    system("clear");
    should work.

  10. #10
    Registered User
    Join Date
    Aug 2011
    Posts
    4
    With what header???

  11. #11
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Look it up. Your IDE has a help file, use it. Or use google.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. clear screen function
    By mrprogrmr in forum C Programming
    Replies: 16
    Last Post: 12-28-2004, 10:49 AM
  2. Clear Screen Function?
    By Punkture in forum C Programming
    Replies: 3
    Last Post: 05-05-2003, 09:25 PM
  3. clear screen function
    By monkeymon in forum C Programming
    Replies: 6
    Last Post: 10-05-2002, 12:23 PM
  4. Clear Screen function..
    By Jez_Master in forum C++ Programming
    Replies: 4
    Last Post: 04-08-2002, 11:23 AM
  5. clear screen function
    By sballew in forum C Programming
    Replies: 4
    Last Post: 10-22-2001, 09:24 PM

Tags for this Thread