April 2018
Intermediate to advanced
222 pages
5h 28m
English
Fixed arrays refer to arrays that have a pre-determined size mentioned at declaration. Examples of fixed arrays are as follows:
int[5] age ; // array of int with 5 fixed storage space allocatedbyte[4] flags ; // array of byte with 4 fixed storage space allocated
Fixed arrays cannot be initialized using the new keyword. They can only be initialized inline, as shown in the following code:
int[5] age = [int(10), 20,30,40,50] ;
They can also be initialized inline within a function later, as follows:
int[5] age ;age = [int(10),2,3,4,5];