Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <string.h>
    size_t strcspn( const char *str,
                    const char *charset );
    size_t _fstrcspn( const char __far *str,
                      const char __far *charset );

Description:
    The strcspn and _fstrcspn functions compute the length of the initial
    segment of the string pointed to by str which consists entirely of
    characters not from the string pointed to by charset.  The terminating
    null character is not considered part of str.

    The _fstrcspn function is a data model independent form of the strcspn
    function that accepts far pointer arguments.  It is most useful in mixed
    memory model applications.

Returns:
    The length of the initial segment is returned.

See Also:
    strspn, _fstrspn

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

    void main()
      {
        printf( "%d\n", strcspn( "abcbcadef", "cba" ) );
        printf( "%d\n", strcspn( "xxxbcadef", "cba" ) );
        printf( "%d\n", strcspn( "123456789", "cba" ) );
      }

    produces the following:

    0
    3
    9

Classification:
    strcspn is ANSI, _fstrcspn is not ANSI

Systems:
     strcspn - All

    _fstrcspn - All

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson