Question 7
Back to Exercise
Which statement about sizeof is true?
- A It is a library function from <stdlib.h>
- B It is an operator, usually evaluated at compile time; its operand is not executed (except for VLAs) Correct
- C It always needs brackets
- D It returns an int
Correct Answer: Option B
sizeof x needs no brackets for an expression (only for a type name, sizeof(int)). Its result is a size_t, and an operand such as i++ is never evaluated.
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!