next up previous contents
Next: By value or by Up: Datatypes representation Previous: Unions   Contents

Structures

They are treated much like C structures. They are always passed as pointers to structures. Similarly, if one structure contains another - it contains pointer to it, not it directly, thus:

        struct foo {
                int x;
                string s;
        }

        struct bar {
                foo f;
                int z;
        }

is translated to:

        struct foo {
                int x;
                struct string *s;
        };

        struct bar {
                struct foo *f;
                int z;
        };



2002-01-28