The author discusses unusual control structures in this chapter. The author first provides the information about debate going on for the use of goto statements in structured programming languages. The author then provides different ways to rewrite the code in such a way that goto statements are not required:
- Rewrite with nested if statements
- Rewrite with a status variable
- Minimize the number of return statements
- Use a return when it enhances readability
No comments:
Post a Comment