strlen(), strnlen()

compute length of string 

Function


SYNOPSIS

#include <string.h>

size_t strlen(const char *s);

size_t strnlen(const char *s, size_t maxlen);


DESCRIPTION

The strlen() function computes the length of the string pointed to by s, not including its terminating null character. The strnlen() function computes the length of s, but never scans beyond the first maxlen bytes of s.


PARAMETERS

s 

Points to a null-terminated string.

maxlen 

The maximum number of characters to scan for the end of string marker before returning.


RETURN VALUES

The function strlen() returns the number of characters in string s that precede its terminating null character. The strnlen() function returns either the same result as strlen() or maxlen, whichever is smaller.


CONFORMANCE

strlen() ANSI/ISO 9899:1990 'ISO C90'.

strnlen() IEEE Std 1003.1-2008 'POSIX.1'.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
strchr(), strstr()


PTC MKS Toolkit 10.4 Documentation Build 39.