Base c: Array

Source: Internet
Author: User
Array:

Http://wenku.baidu.com/link?url=Fg691IL9sVkvlvK8x1WnxD9yU3N4CtGkAVp35TAzePLg2_et212he7wdzLmJ2h89Q-_ M3Q4VTRW4DFD44NNQDUJ27LU0S-JMHZXQMHFH3VQ (Baidu Library Array).
http://www.cnblogs.com/wendingding/p/3678926.html (blog garden, array)//array: A set of data of members of the same data type
Array elements, array subscripts (an index or hint of the position of an array element, subscript zero-based.) such as their own class, each person for the element, the study number is subscript, but the school number is 1 beginning with the
Type descriptor array name [constant expression]={value 1, value 2 ...};
Array format: type descriptor [constant expression] = {value 1, value 2 ...} ;

Array element access: Array name + subscript
Array subscript: Array elements in the array to get ordinal number, zero-based, to the total number of elements of the array minus one; subscript can be a constant or a variable

One difference between int a[10] and a[10]
The front of the type modifier is an array, which defines an array of type int with 10 elements//elements in the array a with subscript 10.

Several arrays of definitions (sample)

char a [5] = {' A ', ' B ', ' C ', ' d ', ' e '};

int b [29] = {0,1,2,3,4,5,6,7,8,9,10};

int C [7] = {[3]=10,[4]=11};

Char d [8] = {[1]= ' a ', [2]= ' B '};

float e [9] = {1.3, 2.6, 3.9, 4.12};

float F [10]= {1.34, 2.68, 4.12,};

//        long  g [11]= {618,314,31415926,31415927};//elements can be not finished, you can assign an initial value, the elements are separated by commas, character array elements with single quotes



Computes array length (static): sizeof (array name)/sizeof (type name)
//

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.