Which type does the sizeof operator yield in C?
-
A
size_t, an unsigned type
Correct answer
-
B
int, a signed type
-
C
long, a signed type
-
D
unsigned char, one byte
Correct answer
A. size_t, an unsigned type
14 views
Explanation
sizeof produces a value of type size_t, an implementation-defined unsigned integer type intended to hold object sizes.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ