Related functions: bcopy (), memcpy (), memmove (), strcpy (), strncpy ()
Header file: # include <string. h>
Define the function: void * memccpy (void * dest, const void * src, int c, size_t n );
Function Description: memccpy () is used to copy the first n Bytes of the memory content specified by src to the address indicated by dest. Unlike memcpy (), memccpy () immediately stops copying if a specific value (int c) is encountered in src.
Return Value: returns the next byte pointer pointing to the value of c in dest. If the returned value is 0, the first n bytes in the memory indicated by src do not contain the bytes whose value is c.
Void * memccpy (void * restrict to, const void * restrict from, int c, size t [Function]
Size)
This function copies no more than size bytes from to, stopping if a byte
Matching c is found. The return value is a pointer into one byte past where c was
Copied, or a null pointer if no byte matching c appeared in the first size bytes of from.
# Include <string. h>
# Include <stdio. h>
Int main ()
{
Char a [] = "string [a]";
Char B [] = "string (B )";
Memccpy (a, B, 'B', sizeof (B); // a [] = "string (B]"
Printf ("memccpy (): % s \ n", );
}