Machine-translated by Google. Questions are authored in English.
Top

Discussion

If a function contains two return statements successively, the compiler will generate warnings. Yes/No ?

  • A.Yes
  • B.No

Answer: A

Correct answer: Yes

Two return statements one after the other make the second unreachable: the first ends the function. Compilers warn about unreachable code because it almost always means the author intended something else.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.