1. Home
  2. Computer Science MCQs
  3. C Programming
  4. The function strlen() returns:

Added 30 Nov -0001

The function strlen() returns:

  1. the number of characters excluding the null terminator Correct answer
  2. the number of characters including the null terminator
  3. the size of the allocated buffer
  4. the number of words in a string

Correct answer

A. the number of characters excluding the null terminator

15 views

MCQSEXAM

Explanation

strlen counts characters up to, but not including, the terminating null character.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C Programming MCQs

Practise all C Programming MCQs

Similar MCQs