You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IsaacShelton edited this page Mar 21, 2022
·
1 revision
Static Array Literal
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}
Result Type
The result type of a static array literal is *$T where $T is the element type provided.
Usage Example
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)
}
}