Dynamic Arrays

Décio Luiz Gazzoni Filho decio at decpp.net
Sun Oct 1 02:03:18 CEST 2006


On Sep 30, 2006, at 6:30 PM, rohan wrote:

> Hello guys, I'm coding a program in C using GMP. I wanted to create  
> a dynamic array, that is an array of unknown size. In my project  
> I'll have to store mpz_t integers into this array. How many  
> integers i'll have?? I dont know! how do i go about solving this  
> problem. I know that mpz_t array[10]; can be done, but I want to  
> initialize and array in which i can keep adding elements, the  
> number of elements can be 1 or xyz. Thanks in advance, Rohan.

The easy way is using C++ and the std::vector class from the STL.  
Have a look at this: http://www.sgi.com/tech/stl/Vector.html.

I agree with Torbjorn, this isn't the proper forum for your question,  
so this represents the maximum extent of my help on the matter.

Décio


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://gmplib.org/list-archives/gmp-discuss/attachments/20060930/e8f74dbb/attachment.bin 


More information about the gmp-discuss mailing list