Namespaces
Variants
Views
Actions

goto statement

From cppreference.com
< c‎ | language
Revision as of 18:34, 31 May 2013 by P12bot (Talk | contribs)

Transfers control to the desired location

Used when it is otherwise impossible to transfer control to the desired location using conventional constructs.

Contents

Syntax

goto label

Explanation

The goto statement transfers control to the location, specified by label. The goto statement must be in the same function as the label it is referring. If goto statement transfers control backwards, all objects, that are not yet initialized at the label are destructed. It is not allowed to transfer control forwards if doing so would skip initialization of an object.

Keywords

goto

Example