C # operations related

C # variable types 

  1. Value delivery type

    1. Integer types: sbyte byte int uint short ushort long ulong char
    2. Floating point: float double
    3. Decimal: decimal
    4. Boolean
    5. Empty type
    6. Conver carrying values ​​are converted to value type
    7. Other types of values ​​may be defined eg enum class 
  2. constant

    1. The value of the constant can not be modified after being defined
    2. Constant type
      1. Integer constant
      2. Floating-point constants
      3. Character constant
        1. It can be an ordinary character or escape character 'x', single quotes
      4. String constant
      5. Define constants
        1. Use const keyword to define
  3. Operators

    1. Arithmetic operators
      1.   +, -, *, /, ++, -- , %  
    2. Relational Operators
      1. ==, !=, > , <, >= , <=
    3. Logical Operators
      1.  &&, ||, !
    4. Bitwise Operators
    5. Assignment Operators
      1.  = , += , /=,  *= ,  ^= ,   % =, -= ,    >>= , <<= , &= , |= 
    6. Other Operators
      1. the sizeof () returns the size of the data type
      2. typeof () Returns the type calss
      3. & Return address of a variable
      4. ? : Conditional expression
      5. If it is determined whether a type is eg if (Ford is Car) is an object inspection Ford Car class
      6. cast as a failure even though the transition exception is thrown Object obj = new StringReader ( "Hello"); StringRead r = obj as StringReader;
  4. Operator Precedence

    1. Consistent with the C ++ (C ++ I am the ape)

 

 

 

 

 

 

 

 

 

Published 24 original articles · won praise 5 · Views 3209

Guess you like

Origin blog.csdn.net/Ellis1993/article/details/105306843