Chapter 5 C # Array

This article is transferred from: http://m.biancheng.net/csharp/50/

Array literally means storing a set of numbers, but in C # the array does not necessarily store numbers, but also other data types.

A variable can only store one value. If you need to calculate the maximum value of 10 variables, you need to define 10 variables, which is very troublesome.

The introduction of arrays brings a lot of convenience to programming. It can store multiple values ​​of the same type through a variable, which can be completed directly according to the subscripts in the array when accessing the values ​​in the array.

The values ​​stored in an array are all of the same data type, and you can perform operations or operations on the values ​​of the array through loops and data manipulation methods.

Enumerations and structures are two special value types. Enumeration types are used to define that certain columns can only be set to specified values. Structures are a special type. Fields, properties, and methods can be defined in structures. member.

In this chapter:
1.  Introduction to C # Array
2.  C # one-dimensional array
3.  C # multidimensional array
4.  Detailed explanation of C # foreach loop usage
5.  C # Split: Split a string into an array
6.  C # bubble sort (Sort method)
7.  C # enum: enumeration type
8.  C # struct: structure type

Guess you like

Origin www.cnblogs.com/hanguoshun/p/12729392.html