Which of the given function differs from the statement’errno is not necessarily set on conversion error’?
Answer: D
Correct answer: strtod()
strtod is the one that does report errors: on overflow or underflow it sets errno to ERANGE, and it also returns a pointer to the first unconverted character. The ato family - atoi, atof, atol - simply return 0 on failure and set nothing, which is why the strto functions should be preferred.
Please log in or register to report this question.