Flow-control structures: Difference between revisions

From Rosetta Code
Content added Content deleted
(Added description of the page, and the Language Features template.)
m (added note that conditional and loop structures have separate articles)
Line 1: Line 1:
{{Language Feature}}
{{Language Feature}}


In this task, we document common flow-control structures. One common example of a flow-control structure is the <code>goto</code> construct.
In this task, we document common flow-control structures. One common example of a flow-control structure is the <code>goto</code> construct. Note that [[Conditional Structures]] and [[Loop Structures]] have their own articles.


==[[C plus plus|C++]]==
==[[C plus plus|C++]]==

Revision as of 22:20, 26 January 2007

Template:Language Feature

In this task, we document common flow-control structures. One common example of a flow-control structure is the goto construct. Note that Conditional Structures and Loop Structures have their own articles.

C++

goto

Compiler: GCC 3.3.4

#include <iostream> 

int main()
{
 LOOP:
  std::cout << "Hello, World!\n";
 goto LOOP;
}

Note that "goto" may also be used in conjunction with other forms of branching.