English
Language : 

CC78K0S Datasheet, PDF (79/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 5 OPERATORS AND EXPRESSIONS
(1) Subscript operator
Postfix Operators
[ ] Subscript Operator
FUNCTION
The [ ] subscript operator specifies or refers to a single member of an array object. The array or expression “E1
[E2]” is evaluated as if it were “(*(E1+(E2)))”. In other words, the value of E1 is a pointer to the first member of
the array and E2 (if it is an integer) indicates the E2th member of E1 (counting from 0). With a multidimensional
array, as many subscript operators as the number of dimensions must be connected.
In the following example, x becomes an int type array of 3*5. In other words, x is an array which has three
members each consisting of five int type members.
int x[3][5];
A multidimensional array may be specified by connecting subscript operators. Assuming that E is an array of nth
dimension (where n ≥ 2) consisting of i*j*...*k, the array can be specified with the n number of subscript
operators. In this case, E becomes a pointer to an array of (n – 1)th dimension consisting of j*...*k.
SYNTAX
postfix-expression [subscripted expression]
NOTE
A postfix expression must have a “.... pointer to object”. The subscripted expression of an array must be
specified with integral type data. The result of the expression will become “.....” type.
User’s Manual U14872EJ1V0UM
79