Discussion
One of the major difference between typedef and #define is that typedef interpretation is performed by the _________________ whereas #define interpretation is performed by the _____________
Answer: C
Correct answer: compiler, pre-processor
#define is handled by the preprocessor, which performs blind textual substitution before compilation begins and understands nothing of types or scope. typedef is processed by the compiler itself, so it obeys scope rules and creates a genuine type alias. This is why #define intptr int * and typedef int *intptr; behave differently when several variables are declared on one line.
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