C strlen()

The strlen() function returns the length of the null-terminated string pointed to by str. The null terminator is not counted.

strlen() Syntax

Following is the syntax of the strlen() function :

size_t strlen(const char *str);

strlen() Example

Following code fragment prints 5 on the screen :

printf("%d", strlen("hello"));

C Online Test

« Previous Chapter Next Function »

Like/Share Us on Facebook 😋