post  How do you clear a screen

award982 (50)   Link to this post
Hey!

So, lets say its like this:

cout << "blahblahblah" <<endl;

and the program that we ran sais this:

blahblahblah
Press any key to continue...

now, how do you delete that sentence blahblahblah?
Dufresne (48)   Link to this post
Easiest way is
 
system( "cls" );

but this isn't suggested.
Many programmers suggest to enter many '\n'.
award982 (50)   Link to this post
okz ty!
Duoas (2964)   Link to this post
AAAaaarrrrrggghhhhh!

Clear The Screen
http://www.cplusplus.com/forum/articles/10515/

Please don't use system( "cls" );. It is evil!
http://www.cplusplus.com/forum/articles/11153/
Dufresne (48)   Link to this post

AAAaaarrrrrggghhhhh!

Clear The Screen
http://www.cplusplus.com/forum/articles/10515/

Please don't use system( "cls" );. It is evil!
http://www.cplusplus.com/forum/articles/11153/


Why i are you so angry ? I said system( "cls" ); is an easy way but this isn't suggested.
firedraco (2048)   Link to this post
Why are you even suggesting it if you know it isn't suggested...?
jloundy (161)   Link to this post
Even a better question: why Do you care?
Duoas (2964)   Link to this post
I wasn't angry. I was frustrated that, after having taken the time and effort to make a simple link to answer such questions, it was not used. Hence, I used a little humor and a droll shove in the right direction to break bad habits before they start. The OP obviously has no idea either way... why perpetuate dangerous programming habits?
Dufresne (48)   Link to this post

Why are you even suggesting it if you know it isn't suggested...?

I didn't suggest it. I said that it's a way to do it.


Duoas (2964)   Link to this post
LOL. Something like this? http://www.cplusplus.com/forum/beginner/1988/
QWERTYman (351)   Link to this post
Hang on. Let me put on my helmet and ready my logic gun before this flame war opens up.
jloundy (161)   Link to this post
for starters, not one of you answered his question, you were to busy aruging that habits of system commands( which is basically what this hole form is about now).

You cannot just delete one line of text from your console, if you dont want it there then dont output it. You can remove the "press any key to continue" by using cin.get().
Bazzy (3180)   Link to this post
@jloundy
not one of you answered his question
Read this again:
AAAaaarrrrrggghhhhh!

Clear The Screen
http://www.cplusplus.com/forum/articles/10515/

Please don't use system( "cls" );. It is evil!
http://www.cplusplus.com/forum/articles/11153/

Last edited on
jloundy (161)   Link to this post
is he trying to clear the hole screen, or just one line of text?
kinley (9)   Link to this post
You could use clrscr(). It is defined in conio.h
Might like to borrow from turbo C compiler.
I am not sure if there could be any compatibility issues.
Disch (1028)   Link to this post
I am not sure if there could be any compatibility issues.


You would be if you read the article Duaos linked. It's mentioned at the end of the first post.

This topic is archived - New replies not allowed.