Вы находитесь на странице: 1из 6

c 

 

  

2 System;

u  MainClass {

2 u u 


Main() {
Console.WriteLine("A simple C# program.");
}
}

  
   


c      


   

      


   
   

   

C:\>csc Example.cs

          ! "## !$    
"  %% &%'  "() *c%(+%,  

 c  "
  !  
 ,  # 
  " 

c   

  uas base bool  


Byte u uuu checked
u  u  u 2 decimal
2 
delegate

2   2
event explicit extern    
fixed  foreach  
 implicit in  u
internal is lock namespace
 2 object operator out
override params     u
2 u
readonly ref 2 sbyte sealed
 sizeof stackalloc ustring
struct u   2
 typeof uint ulong unchecked
unsafe ushort 2 virtual  
 
 


  
 


  uas base bool


 

 u uuu 


checked

u  u  u 2 decimal



2 

delegate

2  
 2

event explicit extern  


  

fixed  foreach


 

 Implicit In Int
Interface

Internal Is lock 


namespace

 2 object operator


out

override params     u



2 u

readonly ref 2 sbyte


sealed

 sizeof stackalloc u


string

struct u  


 2

 typeof uint ulong


unchecked

unsafe ushort 2 virtual


 

   


      

csc /r:System.DLL /r:System.Windows.Forms.DLL /r:System.Drawing.DLL WinEvents
.cs

-(c 



 $     "! 

 # 
 "  


- "   "! 

c 
(c 

c  
!    %"#
!  .!   
     
*  " " 
 ! / !  "   
"  )   "   
 0  
       
!  .!   
  )   
 1   
   1     
  1    
#  * )   c  0   

&     *c    
2 $ 3#  $
 


c    
/ 
/ !  !
)  " 
04  
0 
045   
04  
0 
045   
,  ! 
)!  ! 


 c    " ) 


 c " 3"" 0) 0

 


  "  "#        !" 

 c "     & !  


 c "    # c 66!66

 c "       & 7.5+8 " 
  
5 c " "  & "   & 67& " 
" 
8 c "  "  $#$  '& 778'
 
4 1  ! $ 69: "  $! ;
+  #


cype Primitive Description
Range
bool System.Boolean Boolean
 2 or 

 System.Byte 8-
bit integer 0 to 255

u System.Char 16
bit Unicode character /u0000 to /uffff

decimal System.Decimal 128-


bit decimal (+/-)1.0 10^-28 to (+/-
)7.9 10^28, with 28 to 29 digits of precision

2 System.Double 64-
bit floating point -
1.79769313486232e308 to 1.79769313486232e308

System.Single 32-
bit floating point (+/-)1.5 10^-45 to (+/-
)3.4 10^38, with 7 digits of precision

System.Int32 32-
bit unsigned integer -2,147,483,648 to 2,147,483,647

System.Int64 64-
bit integer -
9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

sbyte System.SByte 8-
bit integer -128 to 127

 System.Int16 16-
bit integer -32,768 to 32,767

string System.String not applicable


String is an immutable variable length string.

uint System.UInt32 32-


bit unsigned integer 0 to 4,294,967,295

ulong System.UInt64 64-


bit unsigned integer 0 to 18,446,744,073,709,551,615

ushort System.UInt16 16-


bit unsigned integer 0 to 65,535

) c 
)  

C# Shorthand CLS Compliant? System cype
Range Meaning in Life

sbyte No System.SByte
128 to 127 Signed 8-bit number

 Yes System.Byte


0 to 255 Unsigned 8-bit number

 Yes System.Int16
32,768 to 32,767 Signed 16-bit number

ushort No System.UInt16
0 to 65,535 Unsigned 16-bit number

Yes System.Int32
2,147,483,648 to 2,147,483,647 Signed 32-bit number

uint No System.UInt32
0 to 4,294,967,295 Unsigned 32-bit number
Yes System.Int64
9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
Signed 64-bit number

ulong No System.UInt64
0 to 18,446,744,073,709,551,615 Unsigned 64-bit number

u Yes System.Char


U0000 to Uffff A single 16-
bit Unicode character

Yes System.Single
1.5 * 10^-45 to 3.4 * 10^38 32-
bit floating point number

2 Yes System.Double
5.0 * 10^-324 to 1.7 * 10^308 64-
bit floating point number

bool Yes System.Boolean


 2 or  Represents truth or falsi
ty

decimal Yes System.Decimal


10^0 to 10^28 A 96-bit signed number

string Yes System.String


Limited by system memory Represents a set of Unico
de characters

object Yes System.Object


Any type can be stored in an object variable che base
u  of all types in the .NEc universe

Оценить