0
So you know how you can clear your screen using system("cls") right but what could you use instead of that because people are telling me system() is evil.
5 Respuestas
+ 1
I dont know what they mean by evil but it might be just that you need to remember to add the library stdlib.h which contains this "system" command
+ 1
The problem is, using system will make your code platform dependent. Cls will work for clearing a dos terminal. It won't work on Linux based system.
+ 1
@Tristan Peters, No, it's not okay to use it. I want to add to the above reason which will justify why it is not. Using system function may expose your program to vulnerabilities. Depending on the access, the attacker may intercept and change the command instead of the one which you intend to run. Now let's say your program is running at the highest possible privilege(or root). Any program you invoke will just run since you've all the privileges. Now an attacker may just change the command and put his command to invoke a malware. This is a very basic example. There are more complex things which can be done.
0
Nick D. so it is ok if I use it in any program I make because I'm on windows.
0
use clrscr() method including the conio.h directory.