C++ goto Statement – Programming, Pseudocode Example, C# Programming Example

C++ goto Statement

It allows making an absolute jump to another point in the program. You should use this feature carefully since its execution ignores any type of nesting limitation.

The destination point is identified by a label, which is then used as an argument for the goto instruction. A label is made of a valid identifier followed by a colon (:).

This instruction does not have a concrete utility in structured or object oriented programming aside from those that low-level programming fans may find for it. For example, here is our countdown loop using goto:


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.