In C, where must the label named in a goto statement be located?
Correct answer A. Anywhere in the same function as the goto
Explanation
Labels have function scope in C: a label can be the target of any goto in the same function, before or after it, but never in a different function. It need not be in the same block, which is why goto is sometimes used to jump to shared clean-up code at the end of a function. Jumping into the scope of a variable-length array is not allowed.
Answer checked How we write and check questions
Discussion