Hi, how do you clear the screen on C++? on VB you used cls to clear the screen, but I don't know what function to use thanks for the help.
Printable View
Hi, how do you clear the screen on C++? on VB you used cls to clear the screen, but I don't know what function to use thanks for the help.
Have a look at http://msdn.microsoft.com/library/de...the_screen.asp
Techniques are a bit naff. Alternatively, if you have ansi.sys loaded, just print
"\033[2J"
You can try
#include <conio.h>
and
call the function
clrscr();
First, there is no function in standard C++ to clear the screen.Quote:
Originally posted by beginner_c++
Hi, how do you clear the screen on C++? on VB you used cls to clear the screen, but I don't know what function to use thanks for the help.
There may be functions that are specific to your operating system that clear the screen. Again, it all depends on the OS that you are running (and compiler brand counts also -- one compiler may call the function cls(), while another may call it clrscr(), while another may call it ClearTheScreen()).
Regards,
Paul McKenzie
If the OP is running anything other than Visual C++, this may not even compile, let alone run.Quote:
Originally posted by vcstarter
You can try
#include <conio.h>
and
call the function
clrscr();
Regards,
Paul McKenzie
<cstdlib>
system("cls");