Overview

To specify an array of a data type, indicate the desired repetition count of the array, in decimal, surrounded by brackets after the variable name. In the example below, 32 values of data type "int" are defined under the variable myArray:

int myArray[32];

 

Users may also define variable length arrays within structures. A variable length character string is demonstrated below:

struct pstring16

{

  unsigned short len;  // 16 bits worth of length

  char content[len];   // Actual string content

};

 

Users can specify expressions within array declarations. For example, consider the need to deserialize an array of bytes:

struct myByteArray

{

  unsigned short rows;

  unsigned short columns;

  __int8 data[rows*columns];

};

More Information on Structure Definitions

Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols.