| Index

| Reference for Wiring 1.0 (ALPHA) 0021+. 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
Examples |  |
    // declaring an array of integers
    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
    }
    // different ways of declaring arrays of chars
    char string1[15];
    char string2[7] = {'h', 'e', 'l', 'l', 'o', '!'};
    char string3[7] = {'h', 'e', 'l', 'l', 'o', '!', '\0'};
    char string4[ ] = "hello there!";
Description |  | An array is a list of data. It is possible to have an array of any type of data. Each piece of data in an array is identified by an index number representing its position in the array. The first element in the array is [0], the second element is [1], and so on.
Syntax |  |
    datatype var[]
    var[element] = value
Parameters |  |
datatype |  | any primitive or compound datatype, including user defined classes
var |  | any valid variable name
element |  | int: must not exceed the length of the array - 1
value |  | data to assign to the array element, must be the same datatype as the array
Returns |  |
Usage |  | Application