How does the use of goto statement affect the readability and maintainability of C++ code?

  • It depends on the context of its usage
  • It generally degrades readability and maintainability
  • It has no impact on readability and maintainability
  • It improves both readability and maintainability
The use of the "goto" statement in C++ is generally discouraged because it can lead to spaghetti code, making the code harder to read and maintain. It creates unstructured jumps in the code, making it challenging to follow the program's flow. Therefore, it often degrades both readability and maintainability.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *