C2 has the following built-in primitive types:
i64: Signed integral types.
u64: Unsigned integral types.
usize: architecture dependent, either i32/i64 or u32/u64.
f64: Single and double precision floating point types, respectively.
void: Same as in C.
For convenience, the char keyword is also available and is identical to the i8 type.
Note that C2 does not have any type specifiers like signed, unsigned, long or short.
The C2 compiler always has a pseudo module called c2. This module is used to store some language symbols such as min/max values and things like build time, etc. For each integral type there exists a minimum and maximum value:
module foo; import c2; i32 highest = c2.max_i32;
It also includes some C types for mapping C declarations in libraries to C2 interface types. See External Libraries for more information.
Pointer types are created by adding an asterix (
*) after the type they refer to, like
void* a; i8* b; Point* c; char** d; // Pointer to a pointer to a char
nil keyword may be used to assign a null value to a pointer:
char* name = nil;
Arrays in C2 differ from C arrays in that
 always comes right after the element type, e.g:
void* a; Point b;
For array types, C2 introduces a new operator, namely
elemsof(). This returns the number
of elements in an array and avoids C macros like:
#define ARRAY_SIZE(x) ( sizeof(x) / sizeof(x) )
sizeof() operator is also still available.