How do you clear a screen

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?
Easiest way is
 
system( "cls" );

but this isn't suggested.
Many programmers suggest to enter many '\n'.
okz ty!
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/

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.
Why are you even suggesting it if you know it isn't suggested...?
Even a better question: why Do you care?
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?

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.


Hang on. Let me put on my helmet and ready my logic gun before this flame war opens up.
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().
@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
is he trying to clear the hole screen, or just one line of text?
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.
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.
Topic archived. No new replies allowed.