Please tell me the difference between system ("cls") and system ("clear").

Asked 2 years ago, Updated 2 years ago, 86 views

The c/c++ erases the system ("cls") and system ("clear") console screens, so please tell me the difference between the two.

c++ c system

2022-09-20 19:33

1 Answers

The system() function is a standard function of the c language. If you put an executable that is already created as a parameter in the form of a string, the program will run.

cls.exe is a command that clears the console window screen during DOS, and clear is a command that clears the terminal screen from Linux.

Therefore, system("cls") means to run the DOS command cls on Windows, and system("clear") means to run the Linux command clear.


2022-09-20 19:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.