Error with clrscr() on Dev C++ 5.4.2

前端 未结 6 1381
孤城傲影
孤城傲影 2021-01-20 14:13

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 returne

相关标签:
6条回答
  • 2021-01-20 14:53

    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.

    0 讨论(0)
  • 2021-01-20 14:56

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

    #include<stdlib.h>
    
    system("cls");
    
    0 讨论(0)
  • 2021-01-20 14:58

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

    0 讨论(0)
  • 2021-01-20 15:04

    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.

    0 讨论(0)
  • 2021-01-20 15:09

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

    0 讨论(0)
  • 2021-01-20 15:14

    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.

    0 讨论(0)
提交回复
热议问题