Блог пользователя mcGyver

Автор mcGyver, история, 4 года назад, По-английски

I have recently start coding in sublime text 3.

I use freopen("input.txt", "r", stdin); and freopen("output.txt", "w", stdout); to get input from input.txt and print output in output.txt.

But whenever my code falls into a infinite loop it stops responding and the program crashes as the size of the output.txt file bocomes so large.

Is there any way to avoid this? I mean can I set a file size limit or something like that?

[p.s: I have heard about terminus but I cannot make it work in my windows 10 os, so I had to use file io method. If anyone using terminus on windows 10, I would be so grateful if you share how you did make that possible too.]

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
4 года назад, # |
Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

This also might help you.

»
4 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Go to Preferences -> Key Bindings. adding this { "keys": ["ctrl+q"], "command": "cancel_build" } line to key bindings and press ctrl+q to stop infinite loop.

when i feel my code has gone into an infinite loop I stop it using ctrl+q /ctrl+c . also end task my current executing program .solves my error