-
-
Notifications
You must be signed in to change notification settings - Fork 9
Polycount Fixed Array Type
IsaacShelton edited this page Mar 21, 2022
·
1 revision
Polymorphic fixed array counts are prefixed with $#
.
$#N
$#count
$#num_elements
Since it's a type modifier, it can be repeated or combined with other type modifiers:
*$#N Type
$#num_int_ptrs *int
$#matrix_width $#matrix_height int
Polycounts can be used both in types and in expressions:
func printFixedArrayLength(fixed_array $#N $T) void {
printf("Length of fixed array is %zu\n", $#N)
printf("Size of fixed array in bytes is %zu\n", $#N * sizeof $T)
}