Thread: help with clrscr();

  1. #1
    Infant of C
    Join Date
    May 2010
    Location
    Karachi, Pakistan
    Posts
    118

    help with clrscr();

    Is there any replacement for clrscr(); function defined in conio.h

  2. #2
    Registered User
    Join Date
    Apr 2011
    Posts
    50
    Some ide's dont even need them like pelles c or code:blocks.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by C_programmer.C
    Is there any replacement for clrscr(); function defined in conio.h
    Read the FAQ on How do I clear the screen?

    Quote Originally Posted by Abhas
    Some ide's dont even need them like pelles c or code:blocks.
    I'm guessing that you are thinking of something else from <conio.h>, e.g., getch().
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Infant of C
    Join Date
    May 2010
    Location
    Karachi, Pakistan
    Posts
    118
    Quote Originally Posted by Abhas View Post
    Some ide's dont even need them like pelles c or code:blocks.
    No Actually i want to clear the screen during the execution of a program.

  5. #5
    Infant of C
    Join Date
    May 2010
    Location
    Karachi, Pakistan
    Posts
    118
    Quote Originally Posted by laserlight View Post
    Thanks a lot it have worked very well!

  6. #6
    Third Eye Babkockdood's Avatar
    Join Date
    Apr 2010
    Posts
    352
    Try system("cls");.
    Quote Originally Posted by The Jargon File
    Microsoft Windows - A thirty-two bit extension and graphical shell to a sixteen-bit patch to an eight-bit operating system originally coded for a four-bit microprocessor which was written by a two-bit company that can't stand one bit of competition.

  7. #7
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by laserlight View Post
    Read the FAQ on How do I clear the screen?


    I'm guessing that you are thinking of something else from <conio.h>, e.g., getch().

    Actually Pelles C does have a "private" (i.e. non-standard) header for conio that does include _clrscr() as a function.

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by CommonTater
    Actually Pelles C does have a "private" (i.e. non-standard) header for conio that does include _clrscr() as a function.
    So, you are saying that Pelles C needs _clrscr()?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #9
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by laserlight View Post
    So, you are saying that Pelles C needs _clrscr()?
    Yes. I know it's "not like everything else"... but it is a non-standards based function to begin with.

  10. #10
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by CommonTater
    Yes. I know it's "not like everything else"... but it is a non-standards based function to begin with.
    No, Pelles C does not need _clrscr(), otherwise your programs have been lacking a call to _clrscr(). Pelles C provides _clrscr() as part of the library it comes with.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  11. #11
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by laserlight View Post
    No, Pelles C does not need _clrscr(), otherwise your programs have been lacking a call to _clrscr(). Pelles C provides _clrscr() as part of the library it comes with.
    Oooookaaaaayyy.... I thought you meant the underscore as in .... _clrscr() as opposed to clrscr() from Turbo C.

  12. #12
    Registered User
    Join Date
    Apr 2011
    Posts
    50
    Quote Originally Posted by C_programmer.C View Post
    No Actually i want to clear the screen during the execution of a program.
    Oh i got it wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. clrscr()
    By koyboy in forum C Programming
    Replies: 3
    Last Post: 05-24-2008, 11:01 AM
  2. Help with clrscr
    By Mrazerty in forum C++ Programming
    Replies: 7
    Last Post: 04-22-2008, 11:20 AM
  3. do i need a lib for clrscr()?
    By FingerPrint in forum C++ Programming
    Replies: 2
    Last Post: 08-02-2006, 12:51 PM
  4. clrscr() function
    By spank in forum C Programming
    Replies: 11
    Last Post: 12-27-2005, 03:07 PM
  5. Clrscr()
    By Jpre in forum C Programming
    Replies: 3
    Last Post: 03-05-2002, 12:42 PM