Variable:
in the In C # , the types of variables are:int,double,string,Char , andbool are some of these types.
In C # , a variable's declaration can be a public global variable, or it can be a local variable inside a method.
For example: You can declare a local variable inside the entry method:
public static void Main (string[] args)
{
int i_01;
Double i_02;
String name1;
Char char1;
BOOL bool_01;
declare the variables, and be sure to initialize them.
i_01=2016;
i_02=3.1415926;
Name= " singing the motherland!" ";
Char1= ' a ';
Bool_01=true;
}
Data type conversions:
Implicitly-Typed conversions:
System.Console.WriteLine (" age =" +18);
convert integers to string types automatically
Explicit type conversions ( coercion type conversions ):
System.Console.WriteLine ((int.) 3.1415926);
force conversion to an integer by a parenthesis
Escape character:
\‘
\"
\\
\b
\ t
\v
\ n
\ r
This article is from the "Smile" blog, please be sure to keep this source http://yiyiweixiao.blog.51cto.com/2476874/1967793
C # variables, data type conversions, escape characters