[] (array access) \ Language (API) \ Wiring ALPHA 1.0
Author: Hernando Barragán
Description: Wiring is an electronic sketchbook and hardware electronics for developing ideas. It is a context for learning fundamentals of computer programming and prototyping with electronics within the context of the electronic arts.
Keywords: Wiring, Processing, Interactive Media, Electronic Arts, Programming, C, C++, Hernando Barragán

Search wiring.org.co:

Reference for Wiring version 0023+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name | ### [] (array access)
Examples |
    int numbers[] = { 90, 150, 30 };
    int a, b;

    void setup() {
      a = numbers[0] + numbers[1]; // Sets variable a to 240
      b = numbers[1] + numbers[2]; // Sets variable b to 180
    }
Description | The array access operator is used to specify a location within an array. The data at this location can be defined with the syntax array[element] = value or read with the syntax value = array[element].
Syntax |
    datatype[]
    array[element]
Parameters |
datatype | any primitive or compound datatype, including user defined classes
array | any valid variable name
element | int: must not exceed the length of the array - 1
Usage | Application
Related | array

Updated on October 13, 2009 01:40:45am PDT