Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

strnlen - determine length of a string up to a maximum length

&pagelevel(4)&pagelevel

Syntax

#include <string.h>

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

Description

The strnlen() function calculates the minimum of the two following values:

  • Number of bytes of the array to which s points, exclusively to the terminating NULL byte

  • Value of the maxlen parameter.

Errors

No errors are defined.

Return val.

Length of the string s or value of the maxlen

parameter when successful. The terminating null byte is not counted.