The function strlen() returns:
-
A
the number of characters excluding the null terminator
Correct answer
-
B
the number of characters including the null terminator
-
C
the size of the allocated buffer
-
D
the number of words in a string
Correct answer
A. the number of characters excluding the null terminator
15 views
Explanation
strlen counts characters up to, but not including, the terminating null character.
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