C- Typedef Questions and Answers

Practice Mode
Showing 10 of 23 questions
Q21
What is typedef struct {int x;} Point; used for?
  • A Declares Point variable
  • B Creates Point as type name for the structure
  • C Defines structure with tag Point
  • D Creates function named Point
Answer: Option B
Explanation: Creates Point as type name for the structure
Q22
Can typedef names be the same as existing type names?
  • A No, compiler error
  • B Yes, but not recommended
  • C Only in different files
  • D Only with structures
Answer: Option B
Explanation: Yes, but not recommended due to confusion
Q23
What is the main benefit of typedef in large projects?
  • A Faster execution
  • B Smaller memory footprint
  • C Better code readability and maintainability
  • D Automatic bug fixing
Answer: Option C
Explanation: Improves code readability and maintainability
Questions and Answers for Competitive Exams Various Entrance Test