|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Mondsreitersmann
Join Date: Jul 1999
Location: Skingrad
Posts: 8,781
|
Hi there,
What is the command in C++ to clear the screen? TIA
__________________
Darum still, füg' ich mich, wie Gott es will. Nun, so will ich wacker streiten, und sollt' ich den Tod erleiden, stirbt ein braver Reitersmann. |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Nov 2001
Posts: 1,965
|
Hi,
Some compilers have a function for this, called clrscr(), you need to include conio.h to use it. Not sure if Dev-C++ supports it. another option is writing new lines to the screen until it's cleared, something like: Code:
for (int i = 0; i < 40; i++) {
cout << endl;
}
HTH & good luck
|
|
|
|
|
|
#3 |
|
Member (9 bit)
Join Date: May 1999
Location: kitchener, Ontario
Posts: 364
|
some (dev-c++) also have system("cls") or system("clear") defined in stdlib.h
|
|
|
|
|
|
#4 |
|
Member (7 bit)
Join Date: Sep 2003
Posts: 90
|
system( char * ) will hand string s to the environment for execution. so, "cls" will clear a dos terminal, and "clear" will clear the screen of a unix terminal (at least on every shell i've ever used).
it is platform dependent. just make an inline function called clear that does a line print a lot like aym_7 suggested. AS |
|
|
|
|
|
#5 |
|
Mondsreitersmann
Join Date: Jul 1999
Location: Skingrad
Posts: 8,781
|
Thank you all for your replies.
|
|
|
|
|
|
#6 |
|
Member (6 bit)
|
I know this is a bit late of a reply but with Dev C++ 4.7.9.0 and higher you can use system("cls") to clear the screen
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|