As repl provides ubuntu compiler for c++, I don't know how to use clear screen function and which header file will be used for that function. kindly guide me.
@RishuMishrahttps://en.wikipedia.org/wiki/ANSI_escape_code
Outputting certain codes to some terminals (including the one repl.it uses) can do specific things to the terminal depending on the code.
The \033[2J clears the screen and resets the cursor and the \033[0;0H moves the cursor to 0,0 (again)
You can change the 0;0 to Y;X to move the cursor to line Y and column X thus allowing you to overwrite only certain portions of your screen. Handy for games and such.
I want to use clear screen function in my c++ code on repl
As repl provides ubuntu compiler for c++, I don't know how to use clear screen function and which header file will be used for that function. kindly guide me.
Outputting certain codes to some terminals (including the one repl.it uses) can do specific things to the terminal depending on the code.
The
\033[2J
clears the screen and resets the cursor and the\033[0;0H
moves the cursor to 0,0 (again)You can change the
0;0
toY;X
to move the cursor to lineY
and columnX
thus allowing you to overwrite only certain portions of your screen. Handy for games and such.