HI, I'm looking for a way to clear the screen on the commando prompt.
I have heard about clrscr(); with #include <conio.h> but i have not been able to make it work.
Help is much appreciated.
Printable View
HI, I'm looking for a way to clear the screen on the commando prompt.
I have heard about clrscr(); with #include <conio.h> but i have not been able to make it work.
Help is much appreciated.
That depends entirely on your system and is not standard. You'll have to look up how your system clears the screen and do that.
First, its command prompt. We are not a war ;p
You probably wasn't able to make it work, because this is not standard C. Some compilers/systems support and some not. As a result, I suggest you not to use it!! Imagine yourself writing code and then giving it to another guy who wouldn't be able to use it, because you had used not-standard libraries, as conio.h
I do not know how to clear the screen via code. One can type "clear" in the cmd and clear the screen, but this is when a program is not executing.
I use windows, i thought about printf a lot of \n in a function
and just call that when i want the screen cleared which should also translate to different systems I think
printf() is standard C, yes, but why do you want that bad to clear the screen?
its neat for the program I'm working on with my group, we dont "need" it but im curious so :o
awesome thanks Matticus
The FAQ doesn't mention another option: install the ncurses or pdcurses library and use the console functions to clear the screen. It's way better than conio.h.
or use win api functions, so you can "goto" an x, and y value, and just print over the text that is there, that way if you want just one line to clear, and leave the rest, you can just clear one line at a time!
it is what i do, as a screen clear and reprint ( of like a menu) becomes kinda "flashy"
( just read faq, and seen Option 6, thats almost what i do!)
and ncurses, or another library, mantioned as part of option 2!
Quote:
HI, I'm looking for a way to clear the screen on the commando prompt.
I like the term commando prompt and I think I'll name my terminals from now on because I have a yeti suit and also commando costume and face paint that I rarely get to use. With my commando prompt I can dress up every day. The main problem I have is that my helmet is a racing car helmet so I might have to go to the army surplass store and get a proper commando helmet. I can probably use the new helmet in Call of Duty as well so I may as well get itQuote:
First, its command prompt. We are not a war ;p