Error

user01 Reply 9 years 25 weeks ago
I am getting an error: invalid operands to binary != (have 'double' and 'void *', when I change to using double instead of int. if(s < limit && array[n] != NULL) {
pichulia Reply 9 years 25 weeks ago
Yes. double and NULL can't compare each other. Because double don't have any way to compare exactly. (== operation) Your mistake is, you are printing just 4 numbers after point by %.4f. if input comes like +0.33333, you will get wrong answer
user01 Reply 9 years 25 weeks ago
I tried using just %lf and %f but that displays 6 decimal points. Also, if I use %g it outputs only 3 decimal points.