Discussion
calloc() returns a storage that is initialized to.
Answer: A
Correct answer: Zero
calloc clears the block it returns, setting every byte to zero. That is its distinguishing feature, and the reason it is preferred where a zeroed structure or a counter array is wanted.
A caution worth knowing: all-zero bytes give an integer value of zero and, on essentially every current implementation, a floating-point zero and a null pointer as well - but the standard guarantees only the integer case. Code that relies on a zeroed block containing valid null pointers is portable in practice rather than in principle.
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