Clearing the screen in C++ using other compilers -


hello i'm interested in learning way clear screen. i'm using c++ seem possible code use known work windows compilers. i'm using ubuntu "g++ compiler".

code have research in order use , have tried...

---this don't work g++ compiler

system("cls"); error: sh: 1: cls: not found system("clrscr"); sh: 1: clrscr: not found 

i stumble upon code works, know prints lot's of lines ...

cout << string(50, '\n'); 

any cleaner methods possibly use ?

the unix command clearing terminal clear.

alternatively, send terminal codes doing same (this varies terminal, sequence works most):

cout << "\033[h\033[2j"; 

(i got sequence running clear | less on system. try , see if same result.)


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -