Arrays in ctypes

In ctypes an array is defined by multiplying a type by the number of elements you want allocated within the array, for example:

In Python
class marijuana_amount(Union):
    _fields_ = [
    ("weed_long", c_long),
    ("weed_int", c_int),
    ("weed_char", c_char * 8),
    ]

c_languagepython-logo