What does the sizeof operator return in C?
A. Size of an array
B. Size of a variable
C. Size of a pointer
D. Size of a function
Answer: Option B
Solution(By Examveda Team)
In C, the sizeof operator returns the size in bytes of the data type or variable provided as its operand. It is often used to determine the amount of memory occupied by a variable or data type.Option A (Size of an array) is incorrect because sizeof returns the size of the data type or variable, not specifically for arrays.
Option C (Size of a pointer) is partially correct; sizeof can be used to determine the size of a pointer data type or a variable, but it is not limited to just pointers.
Option D (Size of a function) is incorrect because sizeof does not apply to functions in C.
Related Questions on Operators and Expressions
What does the ++ operator do in C when applied to a variable?
A. Decrements by 1
B. Adds 1
C. Doubles the value
D. Leaves it unchanged
Join The Discussion