Banodip's blog

By Banodip, history, 5 weeks ago, In English

Hello everyone. I use system("cls"); function to clear the output screen on my IDE. But when I submit my solutions in CodeForces having system("cls"); function, it gives Runtime Error. I have used other CP sites and there's no issue with system("cls"); I would just like to know why.

 
 
 
 
  • Vote: I like it
  • -20
  • Vote: I do not like it

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

What IDE are you using?

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

std::system allows you to invoke operating system commands, and do many bad things other than clearing the screen.

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Oh, I didn't know that. I am kinda new to Competitive programming. Earlier I used to use clrscr(); function in Turbo C++. So I am used to clearing my output screen everytime. Thanx for clearing my doubt.

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Why would the Codeforces server allow your code to have system call permissions? If allowed you may even cause a fork bomb.

  • »
    »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Well, I had no idea about this. I am kinda new to Competitive programming. Earlier I used to use clrscr(); function in Turbo C++. So I am used to clearing my output screen everytime. Thanx

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Why am I getting downvoted? I just asked a genuine doubt.

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I was also going to use fork() , to crash the server but it gave compilation error.