C # Learning Record 2: Advanced Data Storage

Source: Internet
Author: User

1. The difference between a structure and a class lies in the storage and access methods. A structure is a value data type, and a class is a one-to-one reference data type. The so-called value data type storage exists in the heap, and the reference data type is stored in the stack, which is equivalent to storing a pointer. Structure is a common structure question. in C #, the structure is written as follows: struct point {public int x; public int y; public double length (){;;;; return length ;}} 2. The enumerated type is in the following format: public enum toggle {on, off}. The default value of the enumerated variable is 0, and then Increments at a time. Of course, you can also set the first value to 1, so the subsequent values continue to increase. 3. the array format is as follows: decimal [] balances; balance = new decimal [12]; decimal [] ee = new decimal [3] {1, 2, 3}; you can initialize the array directly.

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.