Discussion
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.
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