[Previous]
[Contents]
[Next]

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() function computes 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's 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.
Safety:
Interrupt handler Yes
Signal handler Yes
Thread Yes

[Previous]
[Contents]
[Next]