By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,804 Members | 1,666 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,804 IT Pros & Developers. It's quick & easy.

GMP problem with simple thing

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rafał "ra_v" Zawierta wrote:
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
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.