Csharp/CSharp Tutorial/Language Basics/Variable Definition — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 15:31, 26 мая 2010
Define and assign value to variables
The general form of initialization is shown here:
type var = value;
Dynamic initialization.
Declare two or more variables using the same declaration statement. Just separate their names by commas:
int x, y; // both declared using one statement
Variable definition
A variable is a named memory location that can be assigned a value.
To declare a variable, you will use a statement like this:
type var-name;
- type specifies the type of variable being declared
- var-name is the name of the variable.