I need a Clear Screen Function for C++

Started by
5 comments, last by Starwind8748 22 years, 1 month ago
I am using Code Warrior which doesn''t have the function built in. So can anybody make one that I can use? Thanks in advance for any help.
Advertisement
system("cls")
I think you need stdlib.h

If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.
-----------------------------When men speak of the future, the Gods laugh.An apology for the devil: it must be remembered that we have heard one side of the case. God has written all the books.Samuel Butler (1835 - 1902)
for console applications i think this will be machine dependant.

however, under Win32 i believe: system("cls");.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
try looking into the ansi codes, which will work if ansi.sys is loaded plus windows has api functions for that.
Theres always a better way to do it other than system (I don''t know why, but thats what I always hear experianced people say, and I trust them more than my biased ''commen sense'')
I think theres a function in conio.h called clrscr(), I''m not sure though...it might be stdio.h...

"I''ve learned something today: It doesn''t matter if you''re white, or if you''re black...the only color that REALLY matters is green"
-Peter Griffin
"I've learned something today: It doesn't matter if you're white, or if you're black...the only color that really matters is green"-Peter Griffin
Okay,the system("cls") suits my needs fine, thanks a lot.

What are some other system commands? If you know any I''d appreciate if you gave some to me.
Any DOS command will work in that if you are under windows. Under linux, any shell command will work. Howver, as far as I can remember, system commands don''t work with WinSIOUX ... so if you are having a problem related to that, that is probably the reason.

"If patience is a virtue, and ignorance is bliss, you can have a pretty good life if you''re stupid and willing to wait"
"If patience is a virtue, and ignorance is bliss, you can have a pretty good life if you're stupid and willing to wait"

This topic is closed to new replies.

Advertisement