Dark Horse programmer _ variable depth

Source: Internet
Author: User

1. type conversion of Variables

1. Concept of type conversion

2. implicit conversion

Implicit conversion Principle: For any value type A, as long as its value range is fully included in the value range of value type B, then this type, it can be implicitly converted to B type;

3. Display Conversion

4. Convert string to simple data type

Conversion code Function

 

 

I. Enumeration type

Enum <enumeration Name> {

<Value 1>,

<Value 2>,

<Value 3>,

...

}

<Value 1>,

<Value 2>,

<Value 3>,

...

<Value 1 >=< value in the basic type>, // The default value is 0. The value is customized here.

<Value 2 >=< the default value is the previous value plus 1>, // The next value. If the value of the basic data type is not specified

// Add 1 on the basis of the previous one. Of course, this can also be a custom value.

<Value 3>,

...

3. How to Use

 

 

 

Ii. Structure Type

1. Why structure?

 

2. Define the structure

3. assign values to the structure

 

4. Structure usage

Iii. array type

1. What is an array?

2. Declaration and initialization of one-dimensional arrays

3. traversal of one-dimensional arrays

4. foreach Loop

 

5. Multi-dimensional array

(1)Declaration and initialization Methods

Initialization:

(2) Traversal

 

6. array Array

1) Declaration and initialization Methods

Statement: <Type of each element in the array> [] [] jargedarray;

Initialization: Initialization is slightly different and complicated.

(2) Traversal

 

 

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.