Posted  by 

Clrscr In Dev C++

น้องๆ คนไหนที่เขียน ภาษา C อยู่คงจะเคยเกิดปัญหา ไม่สามารถล้างหน้าจอด้วยคำสั่ง clrscr ได้ ในบทความนี้เรามาเรียนรู้วิธีแก้ปัญหากันครับ. Hasil c akan tetap 4. Printf = untuk menampilkan ke layar getch = Saat kita menekan F9 maka program yang kita buat akan dicompile, lalu untuk menampilkan apa yang kita compile tersebut, juga membutuhkan perintah yaitu getch; cukup dengan menekan CTRL+F9, maka hasil yang kita compile akan ditampilkan di layar monitor kita. Untuk menguji header pada turbo c, dapat dilakukan dengan. Jun 17, 2004  Dev C Clear Screen I just downloaded Dev c because the complier i was using (TC LITE) didn't allow me to make exe files. It also wasn't windows based which is a pain editing in. What i am trying to do is get it to use clrscr. It doesn't acctully tell me how to set up dev to use the clrscr function, it only says that some compilers. Clrscr and Getch in C. Clrscr and getch both are predefined function in 'conio.h' (console input output header file). Clrscr It is a predefined function in 'conio.h' (console input output header file) used to clear the console screen. It is a predefined function, by using this function we can clear the data from console (Monitor). Function getch in C program prompts a user to press a character. It doesn't show up on the screen. Its declaration is in 'conio.h' header file. The function is not a part of standard C.

Dec 27, 2005  Or just realise that the vast majority of command line tools do not begin with any attempt to clear the screen. If they did, they would soon become majorly annoying just to look at and probably majorly annoying if you attempted to say pipe the output to another program.

C++

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!

Clrscr
  • 8 Contributors
  • forum 12 Replies
  • 904 Views
  • 1 Year Discussion Span
  • commentLatest Postby Dave SinkulaLatest Post

Recommended Answers

How To Remove Clrscr Error In Dev C++

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 …

Dev C++ 5.4

Jump to Post

All 12 Replies

frrossk2

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...

Clear Screen In C

super thanks in advance!

Clrscr In Dev C++

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

P: 1
Clear screen 'clrscr() is not a standard function, niether in C or C++. So, using clrscr() is not always give you an answer, and it depends upon the compiler you installed and what library is available too. Some says: include library as: #include <conio.h> , this is also does not help much, and most of the times, it does not work because this library : <conio.h> is not standard library too.
So, to use clear screen, you have to use :
  1. #include <iostream> WHICH IS KNOWN IN C++ and system('cls'); as in the following example:
  2. #include <stdio.h>
  3. // #include <conio.h> some compilers
  4. //ask for this library, but in our case, no need.
  5. #include <iostream> // available in C++ standard Library
  6. int main()
  7. {
  8. char x;
  9. for(int j=0; j<=10;j++)
  10. {
  11. printf('Press any key to clear the screen.n');
  12. scanf('%c',&x);
  13. // >>>>>>>>>>>>>>>>> clrscr(); you can not use it in
  14. // some compilers.......>>>>>>>>>><<<<<<
  15. // instead use this one: system('cls');
  16. system('cls');
  17. //clearscrean then leave 3 linsbefore writing vnew things
  18. for(int k=0;k<=3;k++)
  19. printf('n');
  20. for(int i=0; i<=3;i++)
  21. { // repeat each of the following
  22. // line 4 times
  23. for(int m=65;m<=80 ;m++)
  24. //m=65 is equivalant to character 'A' and so on.....
  25. printf('%c',m); // print m as characters and
  26. // not as decimal
  27. printf('----Look at value of j after each clearscreen YAHIA111%d',j);
  28. printf('n');
  29. }
  30. scanf('%c',&x);
  31. }
  32. return 0;
  33. }