I have this line of code:
int g = modf(ans*power, 1)*10;
And it is giving me the error:
Invalid conversion from \'int\'
modf expects a pointer to a double as its second argument. See here.
modf(ans*power, 1)
is bad
double smthng = 1.0; modf(ans*power, &smthng)
is good.
http://linux.die.net/man/3/modf
modf(double x, double * intpart);
^^^
See modf
I don't see where I am using a pointer
: you're not, and that
is the problem. Look at the signature of modf
:
double modf( double, double* );
It requires a double*
as second argument; you're passing it an
int
.