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>
    void *memchr( const void *buf, int ch, size_t length );
    void __far *_fmemchr( const void __far *buf,
                          int ch,
                          size_t length );

Description:
    The memchr and _fmemchr functions locate the first occurrence of ch
    (converted to an unsigned char) in the first length characters of the
    object pointed to by buf.

    The _fmemchr function is a data model independent form of the memchr
    function.  It accepts far pointer arguments and returns a far pointer.
     It is most useful in mixed memory model applications.

Returns:
    The memchr and _fmemchr functions return a pointer to the located
    character, or NULL if the character does not occur in the object.

See Also:
    memcmp, _fmemcmp, memcpy, _fmemcpy, memset, _fmemset

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

    void main()
      {
        char buffer[80];
        char *where;

        strcpy( buffer, "video x-rays" );
        where = (char *) memchr( buffer, 'x', 6 );
        if( where == NULL )
          printf( "'x' not found\n" );
        else
          printf( "%s\n", where );
        where = (char *) memchr( buffer, 'r', 9 );
        if( where == NULL )
          printf( "'r' not found\n" );
        else
          printf( "%s\n", where );
      }

Classification:
    memchr is ANSI, _fmemchr is not ANSI

Systems:
     memchr - All

    _fmemchr - All

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