Skip to content

Structs in jask

Julius Paffrath edited this page Jan 29, 2019 · 1 revision

Basic information

Jask masters structs, a data type very similar to structs in the C programming language:

struct myStruct
    store 10 in num
    store "Text" in str
endstruct

Structs offer the possibility to declare several variables in groups.

Access struct members

Variables stored in a struct are called struct members. To access them, use the struct operator:

printLine(myStruct->num)
assign "Another text" to myStruct->str