Appearance
Access Array
General Syntax
txt
dataType value = arrayName[index];- dataType: The type of the value you're retrieving from the array.
- value: The variable where the retrieved value from the array is stored.
- arrayName: The name of the array you want to access.
- index: The position (or index) of the element you want to access. Indices usually start from 0.
Example (C/C++/Java)
Retrieves the value at the third position (index 2) in the array "numbers" and assigns it to the variable "value."
cmd
int value = numbers[2];