|
-
May 3rd, 1999, 08:49 PM
#1
Clear screen
Hi,
I am writing a OOP program which create menu using cout. I am not using MFC or
graphic programming. Just simple standard OOP C++ language. Once I select option# from my menu, it will create sub-menu. But the problem is I want to clear the screen from standard output and then sub-menu should written to standard output. I tried but I could not find a key which will clear the standard output. Any suggestions?
Thanks,
Sandeep
-
May 4th, 1999, 09:17 AM
#2
Re: Clear screen
For a quick screen clear, you could output sufficient new lines to scroll any text off the console window...
Otherwise, have a look at the Console Functions such as
ScrollConsoleScreenBuffer, FillConsoleOutputCharacter, etc.
Dave
-
May 4th, 1999, 10:14 AM
#3
Re: Clear screen
for a normal console app, you can use
System ("cls");
--michael
-
May 4th, 1999, 12:40 PM
#4
Re: Clear screen
The Alternative which is better than A System Command or Outputting lines is to use old fashioned Escape characters like 27 73
-
May 4th, 1999, 01:19 PM
#5
Re: Clear screen
Another easy way is :
int main()
{
cout << "the command bellow gonna clear the screen, let's try this...";
cout << "\x1b[2J"; // CLEAR SCREEN
// You need to path ansi.sys into your config.sys (and the \x1b[2J gonna do job
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|