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!