Dynamically create an array of mpz_t's

Sisyphus kalinabears@iinet.net.au
Mon, 11 Aug 2003 11:43:08 +1000


----- Original Message -----
From: "Kevin Ryde" <user42@zip.com.au>
To: "Sisyphus" <kalinabears@iinet.net.au>
Cc: "GMP" <gmp-discuss@swox.com>
Sent: Monday, August 11, 2003 11:17 AM
Subject: Re: Dynamically create an array of mpz_t's


> "Sisyphus" <kalinabears@iinet.net.au> writes:
> >
> > ie what declaration is made,
>
> mpz_t *a;
>
> > and what do the malloc() and free() calls look like ?
>
> a = malloc (count * sizeof(mpz_t));
>
> Ie. mpz_t is like other types in this respect.
>
> > Can it be done (by someone who has only just now learnt how to
dynamically
> > create a 2D array) ?
>
> Beginning C questions are off-topic here, but the way mpz_t is
> declared makes it not quite obvious how it should work.
>

Yes - that lack of obviousness (and my discomfort with pointers) was what
was deterring me from having a play around with it. Still - it doesn't look
too bad - and now that I know for sure it *can* work, I'll give it a go.

Thanks for the starter, Kevin.

Cheers,
Rob