[Solved] Error with clrscr() on Dev C++ 5.4.2

While programming C on the old Turbo C++ compiler I can use the clrscr() method of the “conio.h” header file but not on Dev C++ 5.4.2.(It gives an unusual error Id returned 1 exit status. Although it has nothing to do with the clrscr() and When I removed the clrscr() statement it works perfectly fine! ) So, has the method clrscr() method got deprecated. What is the meaning of the error ?

enter image description here
One more question is “are compiler and library of a language associated”.
So for a particular compiler a corresponding library is like binded to it.

Solution #1:

clrscr() didn’t get deprecated because it was never part of any standard. It was a vendor-specific function provided as an extension by Borland in the (also non-standard) <conio.h> header. Modern compilers no longer provide this function.

There’s a couple of ways to emulate it, and I’m sure you can find it here – just look at the links in the Related section on the right side.

Respondent: Sebastian Redl

Solution #2:

please include stdlib.h file and then call system(“cls”) and enjoy.


Respondent: ritesh anand

Solution #3:

you can use system("cls"); instead of clrscr();

Respondent: Muhammad Abbas

Solution #4:

The Conio.h header is not a part of C Standard Libary. According to wikipedia:

conio.h is a C header file used mostly by MS-DOS compilers to provide console input/output.1 It is not described in The C Programming Language book, and it is not part of the C standard library, ISO C nor is it defined by POSIX.

So you just don’t have this header.

The errors you are getting are linker errors reporting that it can’t find the clrscr() function in any of the headers that hare available for it.

Also, check this question.

Respondent: SingerOfTheFall

Solution #5:

system("cls"); works fine instead of clrscr();

Respondent: amol

Solution #6:

clrscr() will not work untill you download & link conio.o in your project.
Download conio.h , conio.o & then copy paste conio.h in include folder & conio.o in lib folder.
Link conio.o in your project (Project->Project option->Parameters->Add Library or Object) ..
Then run it.

Respondent: udit043

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Most Popular

To Top
India and Pakistan’s steroid-soaked rhetoric over Kashmir will come back to haunt them both clenbuterol australia bossier man pleads guilty for leadership role in anabolic steriod distribution conspiracy