Pointer and array types
Factor handbook » C library interface » Passing data between Factor and C » C type specifiers

Prev:Primitive C types
Next:Word name clashes with C types


Pointer types are specified by suffixing a C type with *, for example float*. One special case is void*, which denotes a generic pointer; void by itself is not a valid C type specifier. This syntax constructs a pointer object to represent the C type.

Fixed-size array types are supported; the syntax consists of a C type name followed by dimension sizes in brackets; the following denotes a 3 by 4 array of integers:
int[3][4]

Fixed-size arrays differ from pointers in that they are allocated inside structures and unions; however, when used as function parameters, they behave exactly like pointers with the dimensions only serving as documentation.