GMP problem with simple thing

  • Thread starter Rafa³ \ra_v\ Zawierta
  • Start date
R

Rafa³ \ra_v\ Zawierta

Hello.
I have to write small program in C based on liberary GMP (GNU Multi
Precision Aritmetic Liberary).

My program have to add and multiply some big numbers, thats why I have
chosen GMP.
So where is the point?
Here:

it works:
mpz_t table[int][int];

but it doesn't:
mpz_set_si (table[5][5], 3); //digits are of course for example

I can compile my program, but when I want to write something to my table or
even print my table on stdout compiled program causes "Segmentation fault"
error when I try to run it.
My table need to be mpz type.

Can you help me?
ra_v
 
K

Kevin Goodsell

Rafa³ "ra_v" Zawierta said:
Hello.
I have to write small program in C based on liberary GMP (GNU Multi
Precision Aritmetic Liberary).

My program have to add and multiply some big numbers, thats why I have
chosen GMP.

We don't discuss particular non-standard libraries here. This group is
for discussion of standard C.
So where is the point?
Here:

it works:
mpz_t table[int][int];

This looks like a syntax error.
but it doesn't:
mpz_set_si (table[5][5], 3); //digits are of course for example

No idea what any of that means, since it is non-standard and you haven't
bothered to supply declarations.
I can compile my program, but when I want to write something to my table or
even print my table on stdout compiled program causes "Segmentation fault"
error when I try to run it.
My table need to be mpz type.

You seem to have a problem with GMP, not C. Find a forum that supports
GMP, or consult the documentation. It is off-topic here.

-Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top