I actually made a mistake, I meant to say system("cls"), this is for windows as i assumed he is using that, system("clear") on the other hand is for Linux and it always works.
And you've just explained non-portable perfectly. It won't work on all systems without modifying the code, therefore it's not portable.
And I'm not sure what you mean by it will delete all the files.
The read carefully what I wrote:
And if you have an O/S that has defined
clear
to be delete all files, you've just destroyed a lot of work.