+ 8

What is the use of system("cls"); function?

25th May 2017, 2:40 PM
Gaurav bhojwani
Gaurav bhojwani - avatar
6 ответов
+ 11
OS dependant (Windows) cmd to clear console screen.
25th May 2017, 3:28 PM
Hatsy Rei
Hatsy Rei - avatar
+ 10
@Gaurav I believe clrscr() function relies on <conio.h> which is now obsolete in most compilers.
26th May 2017, 4:34 AM
Hatsy Rei
Hatsy Rei - avatar
+ 8
Is this also can be used as CLRSCR(); ?
25th May 2017, 9:03 PM
Gaurav bhojwani
Gaurav bhojwani - avatar
+ 4
normaly cls == clear screen
25th May 2017, 2:45 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar
+ 4
For linux, you may use system("clear") ; I use system("cls") along with goto (primitive combo) to make something like a refresh option. Whenever the user presses the assigned key, the screen is cleared and only the useful part is shown. Helps create a page like feel, when I use a while loop along with some if elses... Though this Idea can be considered obsolete by many as I use goto (which is deprecated)...
26th May 2017, 5:01 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 2
system cls clears the screen and then goes to the next statement in the program.
25th May 2017, 2:58 PM
Usama Zafar
Usama Zafar - avatar