Nested structures
fot1
Member Posts: 74
The following code gives an access violation when trying to compile:
struct Bar {
string baz;
};
struct Foo {
struct Bar bar;
};
void main()
{
struct Foo foo;
PrintString(foo.bar.baz);
}
I wonder if nested structures are allowed on this scripting language? Or is this a bug on wine only? 0
Comments
However, built-in structures like vector, effect and location can be used as elements.
TR
I'm using nwn through steam, lastest update, and in the toolset about I see game version v1.80 and toolset
version vts80.
What am I doing wrong?
struct IntList { int intialized; int value; struct IntList next; }; struct IntList IntAppend(struct IntList list, int value) { struct IntList newNode; newNode.initialized = 1; newNode.value = value; if(list.initialized == 0) return newNode; struct IntList i; while(i.next.initialized == 1) { i = i.next; } i.next = newNode; return list; } void PrintIntList(struct IntList list) { struct IntList i; while(list.initialized) { PrintString(i.value); i = i.next; } } void main() { }TR