The type is mostly opaque, but the documentation does give some useful information.
In particular, it is an array [1]
of a struct
type. This tell us that you don't need to call an allocation function to create one. Creating the variable creates the storage, and you can make automatic or static variables and you know where they live.
You do need to call the mpz_init()
function to initialize it, but being an array type, it decays to a pointer in a function call's argument list. That means simply passing the variable (without an &
) means the function can modify that storage. Thus it's (only) important to pay attention to the const
declarations in the function prototypes. It's the one without the const
that is the destination, in all cases.
Being an array type also means that you cannot copy an mpz_t
value with a simple assignment, but rather memcpy
or similar. Because you cannot copy arrays by assignment.