Flushing Stuff In The Console Window

This is a discussion on Flushing Stuff In The Console Window within the C Programming forums, part of the General Programming Boards category; Using conio.h in borland you can clear the stuff in the console window using cls(). I'm using Dev-C++ and as ...

  1. #1
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218

    Flushing Stuff In The Console Window

    Using conio.h in borland you can clear the stuff in the console window using cls().

    I'm using Dev-C++ and as a simple hack to clear the screen I have been writing a load of new lines.

    All the old stuff is still stored somewhere though. I was wondering how you can flush everything displayed in the console window.

    Cheers.

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,171
    There's no standard way. If your program is for Windows only, you can do something like:
    Code:
    system("cls");
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    cls is a DOS/Windows console command.

    clrscr() is for conio.h in Borland.

  4. #4
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    system("cls");
    Thanks.

    clrscr() is for conio.h in Borland.
    Oh. Yeah of course. Its been a while since I used Borland.

  5. #5
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    I prefer :
    Code:
    g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0 );
    but that sort of defeats the whoel purpose of runnign in console mode, then again what was the reason?
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  6. #6
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,810
    Woop?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Console window in VC 2008
    By swgh in forum Tech Board
    Replies: 0
    Last Post: 06-05-2008, 04:13 PM
  2. Adding buttons, edit boxes, etc to the window
    By rainmanddw in forum Windows Programming
    Replies: 1
    Last Post: 04-10-2006, 04:07 PM
  3. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 03:33 PM
  4. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 11:50 AM
  5. Putting stuff in my window...
    By Brian in forum Windows Programming
    Replies: 3
    Last Post: 03-04-2002, 11:37 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21