C# Programming/Keywords/goto
Appearance
The goto
keyword returns the flow of operation to the label which follows it. Labels can be created by putting a colon after any word. e.g.
thelabel: // This is a label
System.Console.WriteLine("Blah blah blah");
goto thelabel; // Program flow returns to thelabel
The use of goto is very controversial, because, when used frivolously, it creates code that jumps from place to place and is disorganized and hard to read. It is rarely even necessary because the same thing can often be accomplished with a more organized for
loop or while
loop.
C# Keywords | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Special C# Identifiers (Contextual Keywords) | |||||||||||||||
| |||||||||||||||
Contextual Keywords (Used in Queries) | |||||||||||||||
|