SEFI2's blog

By SEFI2, 10 years ago, In English

Hello everyone! Yesterday i was upset when my program failed 19test. I didnt have any ideas why it failed.. so i decided to resend my program once again.... ACCEPTED . See my code ( 1 , 2 )

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

»
10 years ago, # |
Rev. 5   Vote: I like it +12 Vote: I do not like it

My experience: if you declare a C-style array (like x) inside a function, it gets located on your program's stack, however it may not be (and usually isn't) cleaned up. It means you've get an array with some possibly random characters. If you're lucky enough, you'll pass. If not, your program will meet an o on the border of the board and possibly change the result.

Examples: http://ideone.com/CcNtNz — declared inside a function (on the program-specific stack); some garbage inside, you should clean it up.

http://ideone.com/LHg3d5 — outside a function (on the heap); it gets initialized = zeroed.

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    :) thank you. i didnt know it ..