
|
Go to the first, previous, next, last section, table of contents.
- newstruct(name)
-
:: Creates a new structure object whose name is name.
- return
-
structure
- name
-
string
-
This function creates an new structure object whose name is name.
-
A structure named name should be defined in advance.
-
Each member of a structure is specified by its name using the operator
-> . If the specified member is also an structure, the specification
by -> can be nested.
[0] struct list {h,t};
0
[1] A=newstruct(list);
{0,0}
[2] A->t = newstruct(list);
{0,0}
[3] A;
{0,{0,0}}
[4] A->h = 1;
1
[5] A->t->h = 2;
2
[6] A->t->t = 3;
3
[7] A;
{1,{2,3}}
- References
-
section
arfreg ,
section structure definition
Go to the first, previous, next, last section, table of contents.
|