ECMA-334: 12. Variables
Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
| C# Language Specification |
| © 2006 ECMA International |
12. Variables
Variables represent storage locations. Every variable has a type that determines what values can be stored in
the variable. C# is a type-safe language, and the C# compiler guarantees that values stored in variables are
always of the appropriate type. The value of a variable can be changed through assignment or through use of
the ++ and -- operators.
A variable shall be definitely assigned (§12.3) before its value can be obtained.
As described in the following subclauses, variables are either initially assigned or initially unassigned. An initially assigned variable has a well-defined initial value and is always considered definitely assigned. An initially unassigned variable has no initial value. For an initially unassigned variable to be considered definitely assigned at a certain location, an assignment to the variable shall occur in every possible execution path leading to that location.