clear screen

Please support our C++ advertiser: Intel Parallel Studio Home
eagleeye eagleeye is offline Offline Jan 29th, 2005, 9:37 pm |
0
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.
Quick reply to this message  
C++ Syntax
  1. #include <iostream>//needs these three lines
  2. #include <stdlib.h>//needs these three lines
  3. using namespace std;//needs these three lines
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. cout << "A simple Demonstartion of system(\"cls\");" << endl;
  8. system("PAUSE");
  9. system("cls");//clears the screen
  10. cout << "The first two lines are gone" << endl;
  11. system("PAUSE");
  12. return 0;
  13. }
0
nico nico is offline Offline | Feb 2nd, 2005
i modified it a little bit for c and it works , i learned one thing today , thanx
 
0
eagleeye eagleeye is offline Offline | Feb 3rd, 2005
Than it's mission has been fulfilled
 
0
bombe bombe is offline Offline | Feb 4th, 2005
hmm. wonder if that works for visual c++
 
0
bombe bombe is offline Offline | Feb 4th, 2005
hmm. wonder if that works for visual c++
 
0
bombe bombe is offline Offline | Feb 4th, 2005
i just tried it on codewarrior C++ and it didn't work ;/
 
0
eagleeye eagleeye is offline Offline | Feb 10th, 2005
Sorry about that, but that's the only thing I could find on how to clear the screen, and so far I could get to work only on Dev-C++
 
0
1o0oBhP 1o0oBhP is offline Offline | 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
 
0
1o0oBhP 1o0oBhP is offline Offline | Mar 23rd, 2005
try substituting <cstdlib> in place of <stdlib.h>
 
0
dave2point0 dave2point0 is offline Offline | Mar 27th, 2005
haven't tried this, but it should work on linux if you replace cls with clear
 
 

Message:


Similar Threads
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC