Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What can array subscripts be represented by?
What can array subscripts be represented by?
Array subscripts can be expressed by integer constants and integer expressions.

For example:

int a[ 15]={ 1,2,3,4,5,6,7,8,9, 10, 1 1, 12, 13, 14, 15 };

int x = 3;

printf("%d ",a[2]);

printf("%d ",a[2 * 3]);

printf("%d ",a[x * x]);

printf("%d ",a[(int)(2.6)];

printf("%d ",a[' \ n ']);