Asked • 03/18/19

Is it ever advantageous to use 'goto' in a language that supports loops and functions? If so, why?

I've long been under the impression that `goto` should never be used if possible. While perusing libavcodec (which is written in C) the other day, I noticed multiple uses of it. Is it ever advantageous to use `goto` in a language that supports loops and functions? If so, why?

2 Answers By Expert Tutors

By:

Larry C. answered • 03/27/19

Tutor
4.9 (294)

Computer Science and Mathematics professional

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.