-
-
Notifications
You must be signed in to change notification settings - Fork 9
Static Array Literal
IsaacShelton edited this page Mar 21, 2022
·
1 revision
Static Array Literals can be used to declare static constant global array values. They are declared with the static
keyword followed by the element type of the static array data. Their primary usage is static initialization.
static int {0, 1, 2, 3, 4}
The result type of a static array literal is *$T
where $T
is the element type provided.
import basics
func main {
c_strings **ubyte = static *ubyte {'Isaac', 'Andy', 'Zack', 'Ellie', null}
for(p **ubyte = c_strings; *p; p = p at 1){
printf("%s\n", *p)
}
}