Discussion
Which of the given function differs from the statement'errno is not neccessarily set on conversion error'?
Answer: D
Correct answer: strtod()
strtod is the one that does report the error: on overflow or underflow it sets errno to ERANGE, and it also returns a pointer to the first character it could not convert. atof, atoi and atol simply return 0 on failure, which is indistinguishable from a legitimate 0 - which is why the strto family should be used in real code.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development