strlen function


strlen will give you the length of a string, NOT including the '\0' terminator. It should not be confused with the sizeof operator which returns the size of a variable (that could hold a string).

Library:   string.h

Prototype: size_t strlen(const char *s);

Syntax:	   size_t size;
	   char string[20]="red dwarf";
           size = strlen(string);

Examples

Example program.

See Also

strlen man page.

sizeof operator.

lenstr - User written version of strlen.


Top Master Index Keywords Functions


Martin Leslie