Step by Step C # language [data type]

Source: Internet
Author: User
  • Data Type

1. Value Type (integer, floating point, and decimal)

Type Alias Category Valid digits Suffix Allowed value
Sbyte System. sbyte
Signed byte type 8-digit None 100
Byte System. byte Unsigned byte type 8-digit None 100
Short System. int16 Signed short integer 16-bit None 100
Ushort System. uint16 Unsigned short integer 16-bit None 100
Int System. int32 Signed integer 32-bit None 100
Uint System. uint32 Unsigned integer 32-bit None, u, u 100u
Long System. int64 Signed long integer type 64-bit None, l, l 100l
Ulong System. uint64 Unsigned long integer 64-bit None, UL, Lu 100ul
Char System. Char Unsigned character type 16-bit None 'A'
Float System. Single Single precision floating point type 32-bit (precision 7-bit) F, F 3.14f
Double System. Double Dual-precision floating point 64-bit (accuracy: 15 to 16) None, D, 3.1415
Decimal System. Decimal Floating Point Type 128 bits (precision: 28 to 29 BITs) M, m
3.14 m
Note: a) the character U represents unsigned;

B) float and double representation: +/-M * 2 to the power of E;

C) decimal representation: +/-M * 10 to the power of E;

D) The values of M and E are determined by type;


2. bool type

Alias: system. boolean. The allowed values are true and false. Example: bool bcount = true;

3. string type

Alias: system. String. The string type is the reference type. There is no upper limit on the characters that make up the string. It is a variable-size memory.

Example: String strcount = "Hello world! ";

This article from the "action is better than words" blog, please be sure to keep this source http://vikxiao.blog.51cto.com/9189404/1549659

Step by Step C # language [data type]

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.