Results 1 to 7 of 7

Thread: Clearing the console window?

  1. #1
    Sc0rp
    Guest

    Question Clearing the console window?

    How would I go about clearing the console window of my app without just looping and filling the whole screen with spaces?


  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I believe :
    PHP Code:
    #include <iostream>

    using namespace std;

    int main()
    {
        
    system("cls");
        return 
    0;

    will work

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Sc0rp
    Guest
    Thanks, that worked.

    BTW, how did you make the code say "PHP"?
    Is there a way to make it C\C++ or VB?

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    For the little I use them, I do C/C++ code in [ PHP ][ /PHP ] tags (without the spaces) and for VB code in the [ vbcode ][ /vbcode ] tags (without the spaces)

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5
    Megatron
    Guest
    If you are using borland, they have a function called clrscr(), which will clear the screen.

    Note that this function is not part of the ANSI standard.

  6. #6
    Sc0rp
    Guest
    I used system("cls") since I try to stick to the ANSI standard.

    BTW, isn't this command system-dependent?

  7. #7
    Megatron
    Guest
    Yes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width