Clear other than "system('cls')"?

Mar 8, 2010 at 3:03am
is there any other way to clear the screen other than
 
system("cls")

(I'm using Dev C++)?
Mar 8, 2010 at 3:13am
bump
Mar 8, 2010 at 3:16am
Search the forum. It's all over the place.
I really shouldn't have even responded because I hate it when people bump their threads out of desperation. I'm aware that that hatred is somewhat unrooted but it just infuriates me.
Last edited on Mar 8, 2010 at 3:17am
Mar 8, 2010 at 3:38am
sorry for that, master. new here. figured it out anyway.
Mar 8, 2010 at 3:59am
Mar 8, 2010 at 4:03am
I eventually used this code, if that tells you anything. (yours, maybe? if so works great btw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
void clear_screen ( void )
{
  DWORD n;                         
  DWORD size;                      
  COORD coord = {0};               
  CONSOLE_SCREEN_BUFFER_INFO csbi;
  HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE );
  GetConsoleScreenBufferInfo ( h, &csbi );
  size = csbi.dwSize.X * csbi.dwSize.Y;
  FillConsoleOutputCharacter ( h, TEXT ( ' ' ), size, coord, &n );
  GetConsoleScreenBufferInfo ( h, &csbi );
  FillConsoleOutputAttribute ( h, csbi.wAttributes, size, coord, &n );
  SetConsoleCursorPosition ( h, coord );
}
Last edited on Mar 8, 2010 at 4:04am
Mar 8, 2010 at 4:33am
closed account (jwC5fSEw)
Advice: bumping after ten minutes isn't going to get you answers any faster. If anything, it'll get you them slower because people won't want to respond.
Mar 8, 2010 at 11:41pm
Thanks for the advice, I already learned my lesson.
Topic archived. No new replies allowed.