954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to make clrscr() work

guys, please help me...

how do i make clrscr() work? my friend told me to include conio.c, but i think that my version of dev-c++ doesn't have that...so i tried downloading conio.c...but the problem is, clrscr() still doesn't work in my pc but it works in my friend's pc...we're both using dev-c++...

what do i need to do? please help me...

super thanks in advance!

potential
Newbie Poster
13 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

guys, please help me...

how do i make clrscr() work? my friend told me to include conio.c, but i think that my version of dev-c++ doesn't have that...so i tried downloading conio.c...but the problem is, clrscr() still doesn't work in my pc but it works in my friend's pc...we're both using dev-c++...

what do i need to do? please help me...

super thanks in advance!


Read this: http://www.daniweb.com/techtalkforums/thread13532-system%28cls%29.html

frrossk
Posting Whiz in Training
220 posts since Sep 2004
Reputation Points: 17
Solved Threads: 9
 

HI WEL I USE BORLAND C++. BUT IT IS SUPPOSED TO WORK ON ANY VERSION OF C++. JUST VERIFY THIS
1. ARE ALL YOOUR HEADER FILE ON A SINGLE FOLDER. MAYBE YOU COULD HAVE INSTALLED IT NOT PROPERLY.
IN TURBO C++ I USE #INLCUDE

AND I USE CLRSCR();

TRY IT ON YOUR DEV C++. BY THE WAY CAN ANYBODY TELL WATS THIS DEV C++. IS IT ANY DIFFERENT FROM TURBO OR BORLAND C++ :lol:

anastacia
Junior Poster
142 posts since Nov 2004
Reputation Points: 11
Solved Threads: 1
 
BUT IT IS SUPPOSED TO WORK ON ANY VERSION OF C++.

NO, IT ISN'T.BY THE WAY CAN ANYBODY TELL WATS THIS DEV C++. IS IT ANY DIFFERENT FROM TURBO OR BORLAND C++ :lol: HTTP://WWW.BLOODSHED.NET/DEVCPP.HTML

DON'T TYPE IN ALL CAPS .

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

Look at the big button on your keyboard marked "Caps Lock". Press it until the CAPITAL LETTERS go away.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

clrscr() is a presumptuous Borland fetish. Not every user of your program wants it!!!

In Dev C++ you can use system("CLS") to do the trick, the old DOS command. Include the stdlib.h for the system() function.

By the way, Dev C++ is a very nice IDE for a set of open source GNU compilers (mainly GCC and G++). The IDE comes in Windows and Linux versions. For Linux CLS has to be replaced with something else.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

not at all a fetish, just overused by people that read tutorials by other people who abused it :)

There can be good reason to use it, for example if you were creating a fullscreen DOS application in Turbo Vision and wanted to clean up after yourself when terminating it.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

ok guys thanks for the clarification.caps lock on was my typing mistake. sorry

anastacia
Junior Poster
142 posts since Nov 2004
Reputation Points: 11
Solved Threads: 1
 

thanks for all the help!

potential
Newbie Poster
13 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

Try to use 'fflush()' function with the argument 'stdout'.
When ever you want to clear your screen, just add this fflush(stdout). But remmember that it will fflush all standard out-put. But you use this. :cheesy:

letmec
Light Poster
33 posts since Sep 2004
Reputation Points: 10
Solved Threads: 2
 
Try to use 'fflush()' function with the argument 'stdout'. When ever you want to clear your screen, just add this fflush(stdout). But remmember that it will fflush all standard out-put. But you use this. :cheesy:

Did you tested it? I really doubt about that...

frrossk
Posting Whiz in Training
220 posts since Sep 2004
Reputation Points: 17
Solved Threads: 9
 

Friends,seems like many of us are having problem in using clrscr() function in DEV C++.We need to know the fact that functions call and return type values which are by default of void type in C but not in c++In c++ we need to tell the function what value is retuned too.
So use void clrscr(void) instead of clrscr().
I hope this works.

ssuryakiran
Newbie Poster
1 post since May 2006
Reputation Points: 10
Solved Threads: 1
 

Please do not resurrect long-dead (and solved) threads.

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You