mpz_array_init problems

mrgrynch at comcast.net mrgrynch at comcast.net
Tue May 31 03:06:35 CEST 2005


It seems the problem here is you are trying to access memory you don't own.   When you define the array, you need to set aside the memory you need first, before initializing it.  Create the array as:

mpz_t p[<num_elements>]

mpz_array_init(p,  <num_elements>, 500)

I hope this helps!
 -Dave


-------------- Original message -------------- 

> I am using version 4.1.3 of GMP with version 3.2.3 of GCC. 
> 
> I need to create an array of multiprecision integers. mpz_array_init looks 
> like it should produce the results I need; however, the code segment below 
> bombs when it executes the mpz_array_init statement. 
> 
> int 
> main() 
> { 
> mpz_t *p; 
> 
> mpz_arrray_init (*p, 10, 500); 
> 
> return (0); 
> } 
> 
> Any suggestions? Anyone have work-around? 
> 
> Thanks. 
> 
> _________________________________________________________________ 
> Is your PC infected? Get a FREE online computer virus scan from McAfee® 
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 
> 
> _______________________________________________ 
> gmp-discuss mailing list 
> gmp-discuss at swox.com 
> https://gmplib.org/mailman/listinfo/gmp-discuss 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gmplib.org/list-archives/gmp-discuss/attachments/20050531/323b4a6e/attachment.html


More information about the gmp-discuss mailing list