System()

Ive been reading around this forum and noticing everyone saying system commands are bad so is there any way on windows to clear your screen without using system("CLS") because i need to clear the screen in some parts of my program

thanks

Oh and another one i use quite regularly is system("color AA") a way to do this i don think you cna unless you have libraries but not sure
> everyone saying system commands are bad

Not every one. There is nothing inherently bad about std::system(); but it has to be used with care. It has the same kind of risks that fork()/exec()/CreateProcess or using a shared library (.so/.dll) have.

Yes, 'Do not call system() if you do not need a command processor'.
https://www.securecoding.cert.org/confluence/display/seccode/ENV04-C.+Do+not+call+system()+if+you+do+not+need+a+command+processor

and: 'Sanitize the environment when invoking external programs'
https://www.securecoding.cert.org/confluence/display/seccode/ENV03-C.+Sanitize+the+environment+when+invoking+external+programs



> is there any way on windows to clear your screen without using system("CLS")

See: http://www.cplusplus.com/forum/beginner/105772/#msg571520

And: http://www.cplusplus.com/forum/beginner/100115/
Topic archived. No new replies allowed.