LearnFrenzy
Sign in Take a free test

Typedef · typedef MCQ · Question 8

Can a typedef be declared inside a function? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links