For char s[] = "hello"; what does sizeof s evaluate to?
-
A
7
-
B
4
-
C
6
Correct answer
-
D
5
11 views
Explanation
The array includes the terminating null character, so it occupies six bytes in total.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is C? Ask here and get an explanation.
Ask a doubt about this MCQ