C # Note

Source: Internet
Author: User
C # data types include: Value Type and reference type.
Value Type:
Variables: from the user's perspective, variables are the basic unit for storing information. From the system perspective, a variable is a storage space in the computer memory.
C # value types include:
Simple Type (simply types)
Structure Type (struct types)
Enumeration types)
Simple Type: (simple variables, C # provide us with a set of simple types that have been defined)
Integer type: (distinguish between mathematical Integer Range and computer Integer Range)
C # There are nine integer types:
Data Type features
Sbyte signed 8-digit integer
Byte unsigned 8-digit integer
Short signed short integer
Ushort unsigned short integer
Int signed integer
Uint unsigned integer
Long signed long integer
Ulong unsigned long integer

Boolean Type:

Used to express true and false feelings. True and false are used in C #.
There is no conversion between the integer type and the boolean type.

Real Number Type:

Floating point type:

Decimals are represented in C # in two types: Float (double)

Decimal:
It is mainly used to facilitate the calculation of financial currency processing (in decimal form)

Define a decimal type, and add m at the end

Character Type: (char)

Unicode Character Set

Variable types in C # cannot be computed with integers.

Structure Type: (struct)
The process of organizing a series of related variables into a single entity is called the process of generating a structure.

There is no limit on the member types contained in the structure type.

Enumeration type: (Enum)

A set of logically inseparable integer values provide symbols that are easy to remember.

A variable of the enumeration type can have only one value at a time. By default, each element of the enumeration type is int.

Value assignment type: Long, Int, short, byte .....

In C #, the keyword is lower case

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.