Hello all,
I have a problem with a C program using GMP.
I boiled the issue down to the following:The error request for member _mp_size in something not a structure or union occurs on the second if statement.Code:#include <stdio.h> #include <gmp.h> int main(void) { mpz_t foo; void *ptrfoo; mpz_init(foo); if(foo->_mp_size == 0) { printf("foo is ZERO\n"); } else { printf("foo is not ZERO\n"); } ptrfoo = foo; if(((mpz_t *)ptrfoo)->_mp_size == 0) { printf("foo is ZERO\n"); } else { printf("foo is not ZERO\n"); } return (0); }
Any idea?
Thanks in advance