Discussion
In which header file is the NULL macro defined?
Answer: C
Correct answer: stdio.h and stddef.h
NULL is defined in several headers, among them stdio.h and stddef.h, and also stdlib.h, string.h, time.h and others.
The duplication is deliberate. A programmer using any of those libraries is likely to need NULL, and the standard permits a macro to be defined identically in more than one header, so each defines it rather than forcing an extra include. stddef.h is the canonical home, holding it alongside size_t and ptrdiff_t.
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