NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
Structures

NXC supports user-defined aggregate types known as structs.

These are declared very much like you declare structs in a C program.

struct car
{
string car_type;
int manu_year;
};
struct person
{
string name;
int age;
car vehicle;
};
person myPerson;

After you have defined the structure type you can use the new type to declare a variable or nested within another structure type declaration. Members (or fields) within the struct are accessed using a dot notation.

myPerson.age = 40;
anotherPerson = myPerson;
fooBar.car_type = "honda";
fooBar.manu_year = anotherPerson.age;

You can assign structs of the same type but the compiler will complain if the types do not match.