Important Points about strlen()

The following points should be kept in mind while using strlen():

  • strlen() does not count the NULL character ‘\0’.
  • The time complexity of strlen() is O(n), where n is the number of characters in the string.
  • Its return type is size_t ( which is generally unsigned int ).

strlen() function in c

The strlen() function in C calculates the length of a given string. The strlen() function is defined in string.h header file. It doesn’t count the null character ‘\0’.

Similar Reads

Syntax of C strlen()

The syntax of strlen() function in C is as follows:...

Example of C strlen()

The below programs illustrate the strlen() function in C:...

Important Points about strlen()

...

Contact Us