<string.h> Functions

C strlen()

The strlen() function takes a string as an argument and returns its length. The returned value is of type size_t (an unsigned integer type).

It is defined in the <string.h> header file.


Example: C strlen() function

Output

Length of string a = 7
Length of string b = 7

Note that the strlen() function doesn't count the null character \0 while calculating the length.