Current .Net Version: 1.1.4322
Home
Articles
Practice C# Online
C# Reference
XML Web Services
RSS Feeds
T-SQL Scripts
Videos
Valuable Links
Contact Us
Mike's C#, VS.NET and SQL Blog
ROR XML Info.
C# Reference
The world's largest C# Language & Framework Class Library Reference Database (second only to Microsoft's)!
Language Reference:
Language Search:
Framework Class Library Reference:
Framework Class Library Search:

goto
Is a:Statement Keyword
Applies to Version:C# 1.0 and later
Namespace:N/A
Assembly:N/A (N/A)
Description:A jump statement that transfers program control to a position in the program where the specified identifier is located.
Syntax:
goto identifier;
goto case constant-expression;
goto default;
MSDN:http://msdn.microsoft.com/library/en-us/csref/html/vclrfTheGotoStatement.asp?frame=true
Example(s):// goto example: String s = ""; s = "Hello"; goto End; s += " World!"; End: // s will store "Hello" and NOT "Hello World!" // goto case example: switch (2) { case 1: break; case 2: goto case 4; break; case 3: break; case 4: /* this will execute */ break; } // goto default example: switch (2) { case 1: break; case 2: goto default; break; case 3: break; case 4: break; default: /* this will execute */ break; }
 
COPYRIGHT/DISCLAIMER | CONTACT US