Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 01-17-2004, 01:39 PM   #1
Mondsreitersmann
 
Nuclear Krusader's Avatar
 
Join Date: Jul 1999
Location: Skingrad
Posts: 8,781
Question Clearing the screen

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.
Nuclear Krusader is offline   Reply With Quote
Old 01-18-2004, 07:49 PM   #2
aym
Registered User
 
aym's Avatar
 
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;
}
this piece of code should compile no matter what compiler you are using.

HTH & good luck
aym is offline   Reply With Quote
Old 01-19-2004, 08:02 PM   #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
rios__ is offline   Reply With Quote
Old 01-19-2004, 08:47 PM   #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
AerynSedai is offline   Reply With Quote
Old 01-19-2004, 09:14 PM   #5
Mondsreitersmann
 
Nuclear Krusader's Avatar
 
Join Date: Jul 1999
Location: Skingrad
Posts: 8,781
Thank you all for your replies.
Nuclear Krusader is offline   Reply With Quote
Old 01-21-2004, 06:17 PM   #6
Member (6 bit)
 
Join Date: Jan 2004
Location: PA
Posts: 53
Send a message via AIM to acidcore
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
acidcore is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:45 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2