•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 427,988 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,461 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
A simple demostration of how to clear the console screen in at least Dev-C++ 4.9.8.0 (I don't know about the other since I've only tried it on this one, but may and probably works,, with few if at all minor adjustments), what more can I say, other than it's not the best way to do it but may be useful.
#include <iostream>//needs these three lines #include <stdlib.h>//needs these three lines using namespace std;//needs these three lines int main(int argc, char *argv[]) { cout << "A simple Demonstartion of system(\"cls\");" << endl; system("PAUSE"); system("cls");//clears the screen cout << "The first two lines are gone" << endl; system("PAUSE"); return 0; }
Comments (Newest First)
ankit_the_hawk | Light Poster | Jan 26th, 2007
•
•
•
•
gr88! not able to being use clrscr() was really pissing me off!
Ancient Dragon | Most Valuable Poster | Aug 24th, 2005
•
•
•
•
Here are some example how to use windows console api functions
http://www.codexxi.com/MyBlocks.html#atConsoleObj
http://www.codexxi.com/MyBlocks.html#atConsoleObj
ShawnCplus | Code Monkey | Apr 6th, 2005
•
•
•
•
system ("cls") and other system commands are handy to get a list of all possible system lines that i know of just go Start>run>cmd>help, it gives a list of all commands that you could use some usefull ones are color ie.
system("color A")
would change the text on the console to bright green (hello matrix)
system("color A")
would change the text on the console to bright green (hello matrix)
dave2point0 | Newbie Poster | Mar 27th, 2005
•
•
•
•
haven't tried this, but it should work on linux if you replace cls with clear
1o0oBhP | Posting Pro in Training | Mar 23rd, 2005
•
•
•
•
try substituting <cstdlib> in place of <stdlib.h>
1o0oBhP | Posting Pro in Training | Mar 23rd, 2005
•
•
•
•
the code should be ANSI standard code to work on all compilers, and i DONT see any un-ANSI code! it should work on others, i have compiled DevC++ projects on MSVC++ Before without any problems
eagleeye | Junior Poster in Training | Feb 10th, 2005
bombe | Newbie Poster | Feb 4th, 2005
•
•
•
•
i just tried it on codewarrior C++ and it didn't work ;/
bombe | Newbie Poster | Feb 4th, 2005
•
•
•
•
hmm. wonder if that works for visual c++
bombe | Newbie Poster | Feb 4th, 2005
•
•
•
•
hmm. wonder if that works for visual c++
eagleeye | Junior Poster in Training | Feb 3rd, 2005
nico | Newbie Poster | Feb 2nd, 2005
•
•
•
•
i modified it a little bit for c and it works , i learned one thing today , thanx
Post Comment
•
•
•
•
DaniWeb Marketplace (Sponsored Links)