liveBook · Manning

Goto

A goto statement or instruction unconditionally transfers program execution to a labeled statement or location within the current execution unit.

How 2 Manning books explain it

Modern C, Third Edition

goto is a C jump statement that transfers execution to a labeled statement within the same function.

How it is used
Uses local jumps chiefly to separate exceptional error cleanup from normal control flow.
How deep it goes
Explains label visibility, jump boundaries, initialization guidance, and the lifetime consequences of backward jumps.
Examples
Uses a backward-jump compound literal example and a buffer-printing function with shared cleanup after allocation errors.
What you can do after
Evaluate local jumps for cleanup and reason about their effects on object lifetime.

Read how Modern C, Third Edition explains goto →

Modern C

goto is a C control-flow statement that transfers execution to a labeled statement within the same function.

How it is used
Handles exceptional control-flow changes, local cleanup, and selected algorithmic jumps within one function.
How deep it goes
Explains labels, same-function transfer, object lifetime, and scope interactions, while deferring fuller automatic-object rules.
Examples
Uses compound-literal retry examples, a contrived labeled jump, and a recursive descent parser for brace-based code indentation.
What you can do after
Apply it to exceptional cleanup and compact algorithmic control flow while checking object lifetime and pointer validity.

Read how Modern C explains goto →

What to know first

Related concepts

Questions about goto

What is goto?

A goto statement or instruction unconditionally transfers program execution to a labeled statement or location within the current execution unit.

Which Manning books explain goto?

Modern C, Third Edition and Modern C.

What should I know before learning goto?

Manning books that teach goto usually introduce compound literal, control flow, loop and reference first.

What is the difference between goto and structured program?

A goto statement or instruction unconditionally transfers program execution to a labeled statement or location within the current execution unit. A structured program is a program whose control flow is organized through sequencing, selection, iteration, and procedure calls rather than arbitrary jumps.

What is goto a kind of?

Goto is a kind of unconditional jump instruction. An unconditional jump instruction is a control-flow operation that transfers execution to a specified location without evaluating a condition.

What is goto part of?

Goto is part of function body. A function body is the block or sequence of code that specifies the computation or actions performed when a function is invoked.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.