LearnFrenzy
Sign in Take a free test

Typedef · typedef MCQ · Question 12

What does typeof give you in C23? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 12 Back to Exercise

What does typeof(arr) copy; declare in C23, where arr is double arr[5]?

  • A A pointer to double
  • B An array of 5 doubles – the same type as arr Correct
  • C A double
  • D It does not compile
Correct Answer: Option B

typeof yields the exact type of its operand, and arrays do not decay inside it. It is useful in macros and when a type is long or likely to change.

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