Examveda
Examveda

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.

This Question Belongs to C Program >> Operators And Expressions

Join The Discussion

Related Questions on Operators and Expressions