Jan 29, 2012 (I can't stand uppercase) Because you use the console to launch your programs, and you want your line of sight on a rest position or want to eliminate some noise. Still you are propably better using the program clear or cls, but no inside the cpp code, xP. I hope that you are refering to C Builder (2011) instead of Borland C(1999).
how to clear screen in dev c++ (12)
For pure C++
You can't. C++ doesn't even have the concept of a console.
The program could be printing to a printer, outputting straight to a file, or being redirected to the input of another program for all it cares. Even if you could clear the console in C++, it would make those cases significantly messier.
- 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.
- Jul 18, 2017 this function is used to clear console screen of turbo C because turbo C use console but other software used another window to show our program’s output. To clear other previous output from console we use clrscr function. Getch getch is another predefined function which is used to hold the console of turbo c.
See this entry in the comp.lang.c++ FAQ:
OS-Specific
If it still makes sense to clear the console in your program, and you are interested in operating system specific solutions, those do exist.
For Windows (as in your tag), check out this link:
Edit: This answer previously mentioned using
system('cls');
, because Microsoft said to do that. However it has been pointed out in the comments that this is not a safe thing to do. I have removed the link to the Microsoft article because of this problem.Libraries (somewhat portable)
ncurses is a library that supports console manipulation:
- http://www.gnu.org/software/ncurses/ (runs on Posix systems)
- http://gnuwin32.sourceforge.net/packages/ncurses.htm (somewhat old Windows port)
For Linux/Unix and maybe some others but not for Windows before 10 TH2:
will reset terminal.
![Clear Clear](/uploads/1/2/6/1/126182146/535301173.jpg)
Is there anyway we can clear only a selected part of the console window?
clrscr() from conio.h & system('CLS') clears the whole screen.
So how to clear screen selectively?
clrscr() from conio.h & system('CLS') clears the whole screen.
So how to clear screen selectively?
For example, one of my old code prints this,
But i want it to be like this, just after the user enters the last element.
Android Dev Console
- 4 Contributors
- forum 6 Replies
- 1,231 Views
- 5 Days Discussion Span
- commentLatest Postby PrimePacksterLatest Post
![Clear Clear](/uploads/1/2/6/1/126182146/932752752.png)
lohath
may be u can use a loop of cout<<endl; statement to get the desired output
or try with graphics.h filling that part of the output with background colour
or try with graphics.h filling that part of the output with background colour
Roblox Dev Console
Edited by lohath: n/a