strlen
Computes the length of a string (function or macro)
#include <string.h>
size_t strlen (
const char *s);
strlen returns the number of characters that precede the terminating NULL character.
The strlen function or macro computes the length of the string pointed to by s.
#include <string.h> #include <stdio.h> main () { printf ("%d\n", strlen ("Howdy") ); printf ("%d\n", strlen ("Hello world\n") ); printf ("%d\n", strlen ("") ); }
produces the following:
5 12 0