Thread: Help with clrscr

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    2

    Question Help with clrscr

    The function clrscr() is not recognised by my C++ compiler. I tried to include the file that defines this function (forgot the name) but it doesn't work. I'm working with MsDev C++ 6.0. Please help!

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    clrscr is not standard so it will not work on all compilers.
    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.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    This will help you do that:
    FillConsoleOutputAttribute()

    Other functions you need for working with consoles are listed here:
    http://msdn2.microsoft.com/en-us/lib...73(VS.85).aspx

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    FAQ on "How do I clear the screen" (bottom suggestion shows Windows code to clear the console).


    FAQ using console functions

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    I'd buy a better C++ book. If yours is teaching you about clrscr(), it's probably going to teach you a lot of other non-standard crap. Is this a Turbo C++ book by any chance?

  6. #6
    Registered User
    Join Date
    Apr 2008
    Posts
    2
    Quote Originally Posted by cpjust View Post
    I'd buy a better C++ book. If yours is teaching you about clrscr(), it's probably going to teach you a lot of other non-standard crap. Is this a Turbo C++ book by any chance?
    If fact, I don't even use a book. I have completely learned the language on several internet tutorials.

  7. #7
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    Quote Originally Posted by Mrazerty View Post
    If fact, I don't even use a book. I have completely learned the language on several internet tutorials.

    You have hardly "completely" learned the language if you thought clrsrc() was standard. There is no substitute for a good C++ book. Try "Thinking in C++" by Eckel - it's free to download.

    In fact, I doubt many have "completely" learned the language. I know I haven't.

  8. #8
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by Mrazerty View Post
    If fact, I don't even use a book. I have completely learned the language on several internet tutorials.
    I guess my comment applies to internet tutorials too -- there's a lot of good stuff out there, but also a lot of crap.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. do i need a lib for clrscr()?
    By FingerPrint in forum C++ Programming
    Replies: 2
    Last Post: 08-02-2006, 12:51 PM
  2. clrscr() in microsoft visual c++
    By canliceset in forum C++ Programming
    Replies: 7
    Last Post: 11-18-2004, 02:40 AM
  3. could anyone help me?
    By yahootew3000 in forum C Programming
    Replies: 13
    Last Post: 10-03-2004, 01:17 AM
  4. clrscr(); not clearing the screen
    By Noobie in forum C Programming
    Replies: 8
    Last Post: 05-01-2003, 01:44 PM
  5. clrscr() blues...
    By CodeMonkey in forum Windows Programming
    Replies: 1
    Last Post: 01-17-2002, 03:20 PM