HP C A.06.05 Reference Manual
Statements
Labeled Statements
Chapter 6152
Labeled Statements
Syntax
labeled-statement
::=
identifier
:
statement
case constant-expression
:
statement
default
:
statement
Description
Labeled statements are those preceded by a name or tag. You can prefix any statement
using a label so at some point you can reference it using goto statements. Any statement can
have one or more labels.
The case and default labels can only be used inside a switch statement.
Example
if (fatal_error)
goto get_out;
. . .
get_out: return(FATAL_CONDITION);
The return statement is labeled get_out.