PDA

Click to See Complete Forum and Search --> : Clear a dos windows


DaoK
Sep 28th, 2001, 06:36 PM
I know in dos to clear is : cls
But how can I do that in c++?

crptcblade
Sep 28th, 2001, 06:39 PM
system("cls");


:)

Wynd
Sep 28th, 2001, 06:44 PM
Btw, you need to include stdlib.h ;)

crptcblade
Sep 28th, 2001, 06:46 PM
:rolleyes: Forgot that part. Thanks Wynd.

:)

DaoK
Sep 28th, 2001, 06:58 PM
Thx you Wynd and Blade.:)

Zaei
Sep 28th, 2001, 08:22 PM
Is there a faster way?

Z.

crptcblade
Sep 28th, 2001, 08:36 PM
Originally posted by Zaei
Is there a faster way?

I guess using ASM to do it would be a little faster, but I don't know.

CornedBee
Oct 1st, 2001, 09:03 AM
there may be a windows API function that clears the console window

JoshT
Oct 1st, 2001, 12:33 PM
http://www.mvps.org/vcfaq/lang/7.htm

sail3005
Oct 1st, 2001, 03:41 PM
i still think system("cls") would be faster

filburt1
Oct 1st, 2001, 03:46 PM
If you have a Borland compiler, conio.h has clrscr() or something like that.

sail3005
Oct 1st, 2001, 03:51 PM
yeah, but i would say it is best to stick to system("cls") it has just basically become the standard way of doing it. that way, people reading your code will know what you are talking about.

filburt1
Oct 1st, 2001, 03:59 PM
Does that fork a process?

DaoK
Oct 1st, 2001, 04:10 PM
system("cls");
Work perfectly, and I am using C++ of Microsoft:D

sail3005
Oct 1st, 2001, 06:53 PM
cool. i don't see a need to use things just to be different. thats why it's good to use system("cls")

DaoK
Oct 1st, 2001, 07:23 PM
I always prefer use the easy way :)