Is it possible, somehow after running for, to check whether the loop has ended by itself or was interrupted by a break?

    1 answer 1

    Enter the variable and, before break, coax it.

    • How missing is break n, which is even in php, but there is no c # - vitidev
    • one
      So there it is, only transparent to the programmer - Smithson
    • one
      @vitidev, in c # for this goto is - Grundy
    • one
      @Smithson: This is a spaghetti code - moveton. A goto is quite a nothing, just need to use wisely and, if necessary. - VladD
    • one
      @Smithson goto, break, continue is essentially the same, unconditional transition. Unconditional jumps in high-level code, as a rule, lead to a deterioration in the readability of the code and the inability to read the code from top to bottom. There are many opinions on this matter, as well as about how much return should be in a function, but the essence boils down to one, if there is a real need for an unconditional transition, there is nothing bad in it, if you are just too lazy to understand and write the correct condition for the cycle - then yes, moveton. - rdorn