DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

strlen(D3)


strlen -- determine the length of a string

Synopsis

   #include <sys/types.h>
   #include <sys/ddi.h>
   

size_t strlen (const char *sptr)

Description

The function strlen determines the length of characters in the string pointed to by sptr.

Arguments

The argument sptr points to a string, which is an array of characters terminated by a null-character.

Return values

The function strlen returns the number of characters, not including the terminating null-character, in the string pointed to by sptr.

Usage

strlen is often used to determine the length of a string prior to allocating space to hold a copy of the string. In this case, remember to allocate one more byte than the size returned by strlen, to hold the null-character.

Context and synchronization

All contexts.

Hardware applicability

All

Version applicability

ddi: 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

References

bcmp(D3), bcopy(D3), kmem_alloc(D3), strncat(D3), strncmp(D3), strncpy(D3)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005