StructToCharArray

Copy POD structure to uchar type array.

bool  StructToCharArray(
   const void&  struct_object,     // structure
   uchar&       char_array[],      // array
   uint         start_pos=0        // starting position in the array
   );

Parameters

struct_object

[in]  Reference to any type of POD structure  (containing only simple data types).

char_array[]

[in] uchar type array.

start_pos=0

[in]  Position in the array, starting from which the copied data are added.

Return Value

Returns true if successful, otherwise false.

Note

When copying, the dynamic array automatically expands (ArrayResize) if there is not enough space. If the array cannot be expanded up to the required value, the function returns an error.

See also

StringToCharArray, ShortArrayToString,CharArrayToStruct, Use of a Codepage, FileWriteStruct, Unions (union), MathSwap