Data types for the C # language Foundation

Source: Internet
Author: User

Data Type

1. Value types
(1) integer type: signed integer and unsigned integer type.

The difference is that unsigned integers are larger than the positive range of a signed integer. 2x+1

signed integer : sbyte,short,int, long with positive negative, range increased by write

unsigned integer : Byte,ushort,uint,ulong only positive, and the range is increased in turn

(2) Float type : float, double, decimal

(3) character type (Unicode type):char= ' Hello world! ’

(4) Boolean type :boll(Ture,false) (judging with T or F)

(5) date Time type :datetime Date Time type save date time

(6)

(7) DateTime type : datetime

(8) enum type : Enum e{...} User-defined type of shape

(9) structure type : struct s{...} Form user-defined type

2. Reference types

(1) String type :string (with double quotation mark "")

String is equivalent to the concept of a character type, long length, the definition of the need to use double quotation marks

(2)var variable type stores all types of data---a wide range of storage types

3. value types differ from reference types:

Value types store numeric values directly, the reference type stores an address, reads the address first, and then reads the value from the address

4. Kanji is a string, can not be converted to int characters, string can not be mathematical operations, the concatenation between the strings with A +, such as : A + "You" +b+ "good" +c


Data types for the C # language Foundation

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.