Question 8
Back to Exercise
Is a typedef inside a function body allowed?
- A No, only at file scope
- B Yes – it has block scope like a local variable Correct
- C Only with static
- D Only in main()
Correct Answer: Option B
typedef names follow the normal scope rules. A local typedef is visible to the end of its block and hides an outer typedef with the same name.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!