当前位置:网站首页>Chengdu test equipment development_ Array introduction of C language for single chip microcomputer

Chengdu test equipment development_ Array introduction of C language for single chip microcomputer

2022-06-22 14:19:00 u010755676

Chengdu test equipment development Co., Ltd _ Single chip microcomputer C Introduction to the array of languages

SO Technology sharing 34

    This article introduces about C Language array related knowledge , Such as array definition 、 Application of array 、 Array usage, etc .

What is an array ?

Array (Array) Is an ordered sequence of elements .

An array is a collection of data of the same type . An array can be decomposed into multiple array elements , Elements can be found with labels . Arrays can have one-dimensional arrays , Two dimensional array ……N Dimension group .

What's the use of arrays ?

Look up the table : When determining one or more dimensions ( Or labelling ) after , To find and obtain data from another dimension or dimensions ;

It is convenient to call several similar data : Such as , Use several similar variables , One way is to define multiple variables separately , Another way is to define an array , Manipulate arrays with labels . Obviously arrays are simpler .

other .

To define an array

  Arrays need to be defined before being used , Format bits defined by the array : Definer Array name + Array dimensions .

The definer is used to determine the data type of array elements , Such as character (char)、 plastic (int)、 Long integer (long) etc. .

Array name is the name of the array , When calling arrays in the program, you need to use .

Dimension is to group and size arrays .

Use of arrays

  Before using an array, you need to define .

Array assignment will be used . Array assignment is usually done in the process program , Assignment can be done directly by assignment expression , An element of the array is placed to the left of the equal sign . You can give values directly , Or give variable expressions .

Array queries are also used . For example, take an element of the array to judge 、 Calculation, etc . Array queries also use assignment expressions , The array elements to be queried are placed to the right of the equal sign .

Summary

    Arrays are generally used for the use and processing of large quantities of data , Using arrays will save code , It will make the program simpler and easier .

At the end of this section , Wonderful to be continued .

原网站

版权声明
本文为[u010755676]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221255444907.html