FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. 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 = new int[3]; 
numbers[0] = 90; 
numbers[1] = 150; 
numbers[2] = 30; 
int a = numbers[0] + numbers[1]; // Sets variable a to 240 
int 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   Web & Application
   
Related   Array
 
 






   
 
Updated: Fri Jul 15 16:35:29 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info