Definition: struct

In both C and Python a struct, or structure, is simply a group of variables of homogenous or heterogeneous datatypes which can be accessed using dot notation (e.g. group.var, indoctrinator.victim, ford.mustang, etc).

 

Examples

In C:


struct conspiracy
 {
 int corrupt_police
 int corrupt_medics
};

In Python:


class conspiracy(Structure):
    _fields_ = [
 ("corrupt_police", c_int),
 ("corrupt_medics", c_int),
]

 

 

 

python-logo