C Programming/C Reference/nonstandard/memccpy

The Memccpy function ( which stands for "copy bytes in memory" ) is mainly a function of C Standard Library, typically associated with some type of programming languages.This function operate on strings in memory areas. The memccpy function shall copy bytes from one memory area to other, stopping after the first occurrence of some byte X (converted to an Unsigned char) or after n bytes are copied, whichever comes first.

Syntax



 * {| class = 'wikitable'

!  Argument  !! Description In above syntax,  is a. It is unsigned data type defined in.
 * dest || It points to the location of a destination string.
 * src || It points to the location of a source string.
 * c || It specifies a character for which to search and copy.
 * n || It specifies the number of characters to be copied.
 * }
 * c || It specifies a character for which to search and copy.
 * n || It specifies the number of characters to be copied.
 * }
 * }

Description

 * Here memccpy function shall copy bytes from the memory area src into dest, stopping after the first occurrence of byte c, or after n bytes are copied, whichever comes first. Here character c is also copied.

Returns

 * The memccpy function returns a pointer to the next character in dest after c or NULL if c was not found in the first n characters of src.

Application Usage

 * The memccpy function does not check for the overflow of the receiving memory area.

www.pubs.opengroup.org

www.kernel.org

www.sandia.gov