##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# goto statement

From cppreference.com
< c‎ | language

Transfers control to the desired location

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

### [edit] Syntax

`goto` label |  |

### [edit] 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.

### [edit] Keywords

`goto`

### [edit] Example

| This section is incomplete Reason: no example

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/language/goto&oldid=48937"
Category:

- Todo no example