strlen, _fstrlen

compute the length of a string

Synopsis:

#include <string.h>
size_t strlen( const char *s );
size_t _fstrlen( const char __far *s );

Description:

The strlen() and _fstrlen()functions compute the length of the string pointed to by s.

The _fstrlen() function is a data-model-independent form of the strlen() function that accepts far pointer arguments. It is most useful in mixed memory model applications.

Returns:

the number of characters that precede the terminating null character

Examples:

#include <stdio.h>
#include <string.h>

void main()
  {
    printf( "%d\n", strlen( "Howdy" ) );
    printf( "%d\n", strlen( "Hello world\n" ) );
    printf( "%d\n", strlen( "" ) );
  }

produces the output:

5
12
0

Classification:

strlen() is ANSI; _fstrlen() is WATCOM.

Systems:

strlen()
All (except DOS/PM)
_fstrlen()
All (except Netware, DOS/PM)