0

what syntax will i use?

i dont know how to create an array with syntax and to inherent it. ,

16th Aug 2016, 3:48 AM
augustin maputol
augustin maputol - avatar
2 Respuestas
+ 1
datatype arrayName[ ]={element1,..., elementn}; example: int arraySample [ ] = {1,3,2,77,9}; To call the element just type: arraySample[x]; which x is number of element start with 0.
16th Aug 2016, 4:21 AM
Arie Wijaya
Arie Wijaya - avatar
0
Here's another way to declare an array. datatype [] array_name = new datatype [array_size]; This creates an array of the specified datatype and with a maximum size specified by the array_size.
16th Aug 2016, 11:49 AM
Beardman13