Integer type in C #

Source: Internet
Author: User

Number of data types: System. compatible with CLS? With or without symbols
Sbyte 8 SByte No
Ushort 16 UInt16 No
Uint 32 UInt32 No none
Ulong 64 UInt64 No

Byte 8 Byte is none
Short 16 Int16 has
Int 32 Int32 has
Long 64 Int64 is available
In C #, the integer type of the variable is mainly divided into the above classes.
The signed integer and byte types belong to the general language Authentication System (CLS. The unsigned integer does not belong to CLS.
You can use the original type keyword (such as int) or the corresponding alias (such as System. Int32). Both methods are feasible. The only exception is that when you use the type name as the real parameter of the. net framework function, you can only use System. Int32, but not int. For example, you must call: Type. GetType ("System. Int32"), and the Type. GetType ("int") statement is incorrect. This is because int Is only a keyword in C #, And. net framework functions are designed to be common in all. net languages. Note that byte is unsigned in C.
Note: byte and sbyt have only eight bits, so they cannot be used as array elements because the minimum size of array elements is 16 bits (2 bytes ).

 

Author: ershouyage

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.