codescracker


c

C strlen()



« Previous Chapter Next Function »


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 :

#include<string.h>
size_t strlen(const char *str);

strlen() Example

Following code fragment prints 5 on the screen :

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

« Previous Chapter Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test