Sorry to be such a gimmy gimmy... but I couldn't find any threads on some code that clears the screen, just like DOS's 'CLS' and Bash's 'Clear'...I need a function that does the same thing as both CLS and Clear. Thanks for reading and or helping out.
Geek-Master
Recommended Answers
Jump to PostHmm.... 'clrscr()' from 'conio.h' should serve your purpose
Jump to PostYou don't want to do that. It's considered rude in command line programs and in all others building up your own screen will replace what's underneath it anyway (at least while your application is running).
There's no platform independent way to achieve it btw (probably because of that) so …
Jump to Post>I need a function that does the same thing as both CLS and Clear.
#include <stdlib.h> #include "system.h" void clear() { #if defined(DOS_BASE) system("CLS"); #elif defined(UNIX_BASE) system("clear"); #else #error Unsupported system #endif }
Will it work? Probably, provided you define either DOS_BASE or UNIX_BASE in system.h. Is …
Jump to PostJust to be sure that we are on the same page... the function should only clear the 'output' on the screen... not do anything with the actual program or command prompt. I want to create 'animation' in the command prompt, I have done this before with Batch files by echoing …
Jump to PostAt least you can admit it. Kudos.
All 29 Replies
jeanatkin
0
Newbie Poster
jwenting
1,889
duckman
Team Colleague
Narue
5,707
Bad Cop
Team Colleague
Geek-Master
Narue
5,707
Bad Cop
Team Colleague
Geek-Master
Narue
commented:
Merry Christmas -Narue
+1
Narue
5,707
Bad Cop
Team Colleague
Geek-Master
jwenting
1,889
duckman
Team Colleague
1o0oBhP
4
Posting Pro in Training
Geek-Master
Narue
5,707
Bad Cop
Team Colleague
Geek-Master
Narue
5,707
Bad Cop
Team Colleague
odee
0
Light Poster
Geek-Master
1o0oBhP
4
Posting Pro in Training
odee
0
Light Poster
Geek-Master
Dave Sinkula
2,398
long time no c
Team Colleague
Geek-Master
odee
0
Light Poster
Dave Sinkula
2,398
long time no c
Team Colleague
Geek-Master
odee
0
Light Poster
Dave Sinkula
2,398
long time no c
Team Colleague
odee
0
Light Poster
Geek-Master
Narue
5,707
Bad Cop
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.