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 Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <string.h>
    void *memccpy( void *dest, const void *src,
                   int c, size_t cnt );
    void __far *_fmemccpy( void __far *dest,
                           const void __far *src,
                           int c, size_t cnt );

Description:
    The memccpy function copies bytes from src to dest up to and including
    the first occurrence of the character c or until cnt bytes have been
    copied, whichever comes first.

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

Returns:
    The memccpy function returns a pointer to the byte in dest following the
    character c if one is found and copied, otherwise it returns NULL.

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

    char *msg = "This is the string: not copied";

    void main()
      {
        auto char buffer[80];

        memset( buffer, '\0', 80 );
        memccpy( buffer, msg, ':', 80 );
        printf( "%s\n", buffer );
      }

    produces the following:

    This is the string:

Classification:
    WATCOM

Systems:
     memccpy - All, Netware

    _fmemccpy - All

See Also:
    memcpy, memmove, memset

See Also:

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