Thread: Clear screen command

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    5

    Unhappy Clear screen command

    Anyone know the code to clear screen in output off hand, i can't find it any of my books, but there has to be one out there.!
    thnx

  2. #2
    Registered User
    Join Date
    Jun 2002
    Posts
    82
    Claus Hetzer
    Compiler: Borland 5.5 (on Windows)
    Solaris CC (on Unix)
    Known Languages: C++, MATLAB, Perl, Java

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    5
    thanks!!

  4. #4
    Registered User
    Join Date
    Oct 2002
    Posts
    5

    Unhappy

    i'm using a visual studio 6 on a windows xp os.. none of the methods in the FAQ work for this application, anyone else have any ideas

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by digarren
    i'm using a visual studio 6 on a windows xp os.. none of the methods in the FAQ work for this application, anyone else have any ideas
    There are at least two options that will work there. You obviously haven't tried them all. There's actually three, if you count tossing your monitor out the window.

    Quzah.
    Hope is the first step on the road to disappointment.

  6. #6
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    #include <stdlib.h>

    int main()

    {

    system("cls");

    return 0;

    }

  7. #7
    Registered User
    Join Date
    Oct 2002
    Posts
    5
    ride or die got it, not sure what apps the other codes are supposed to work on, but i did try them all, cept the out the window one....was getting close...it is just a simple decryption program and i wanted to clear screen after each attemp.

  8. #8
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by digarren
    ride or die got it, not sure what apps the other codes are supposed to work on, but i did try them all, cept the out the window one....was getting close...it is just a simple decryption program and i wanted to clear screen after each attemp.
    No you didn't. You didn't try them all or you would have found one that worked:

    Option 1: You don't have conio.h so this wouldn't work.
    Option 2:
    putchar some newlines until everything is scrolled off of the screen.

    You didn't do that, or it would have worked. See, we're only at #2, and already you have one that works. You just didn't feel like doing anything so you said you tried.

    "We are men of action. Lies to not become us."

    Quzah.
    Hope is the first step on the road to disappointment.

  9. #9
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    eh glad i could help.

  10. #10
    Registered User
    Join Date
    Oct 2002
    Posts
    5

    Question

    Hey quzah!!!

    your right, that would have worked, but i wanted something a little more proffesional, don't think i would have got a good mark for running the screen...but thanks for your input..as a first year programmer i appreciate any help.

  11. #11
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    This has been handled more times that I can remember.

    Solution is in the FAQ.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting a clear screen...
    By Finchie_88 in forum C++ Programming
    Replies: 13
    Last Post: 09-03-2004, 05:38 PM
  2. Clear Screen Again!!!
    By trang in forum C Programming
    Replies: 3
    Last Post: 12-13-2003, 08:36 AM
  3. Yet another clear screen thread :D
    By kermit in forum Linux Programming
    Replies: 2
    Last Post: 11-20-2003, 05:14 AM
  4. How to clear the screen?
    By Zopyrus in forum C++ Programming
    Replies: 8
    Last Post: 11-07-2003, 10:20 PM
  5. clear screen code, can't get it to work
    By Unregistered in forum C++ Programming
    Replies: 11
    Last Post: 01-25-2002, 01:38 PM