Namespaces
Variants
Views
Actions

goto statement

From cppreference.com
< c‎ | language
Revision as of 21:25, 2 November 2012 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 Template:sparam

Explanation

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

Keywords

goto

Example