[Foundation and theory] C # variables

Variables related to the stored data, the data can be placed in the variable, the variable may be removed from the data or view thereof.
While all the data in the computer are in fact the same thing (a set of 0 and 1), but have different connotations variable, called type.
C # syntax definition of a variable is specified and the type and variable names in the following format:
// <type> <name>;
 // For example, the definition of an integer type, named Number 
int Number; // Remember semicolon

 Use variable is not defined before (find either variable xxx) or using unassigned variables will complain!


Simple types, the type substantially consisting of the application member. There is no simple type and sub-type characteristics. Most simple types are stored values.
Simple types - integer type:

 

 Above type top right to bottom, from small to large. Large type can contain small type.


Simple types - text and Boolean type:

No upper limit on the number of characters in the string, because it can use variable-sized memory.


Variable naming rules:
  1. The first letter of the variable name must be a letter, underscore (_) or @
  2. Subsequent characters can be letters, numbers or an underscore

Literals

Guess you like

Origin www.cnblogs.com/gme5/p/11797491.html