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?
It is in Turbo Pascal, but you can translate the important parts to Turbo C easily enough. Just a couple notes for you: uses Graph; corresponds to #include Individual Borland graphics routines are named similarly (I think TC puts them all in lowercase though). Depending on which version of C you're using. Borland will allow you to easily set the cursor position and then overwrite what you need. You can also just KEEP all of the data in an array or list and rewrite just the part you want when the screen is fully cleared.
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.
- 4 Contributors
- forum6 Replies
- 1,415 Views
- 5 Days Discussion Span
- commentLatest PostLatest Postby PrimePackster
Recommended Answers
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
C++ Clear Screen Function
Depending on which version of C++ you're using...
Borland will allow you to easily set the cursor position and then overwrite what you need.
You can also just KEEP all of the data in an array or list and rewrite just the part you want when the screen is fully …
All 6 Replies
How To Clear Output Screen In Turbo C++ Hp
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