memccpy

Copies characters sequentially between strings in memory areas.

Format

#include  <string.h>

void *memccpy  (void *dest, void *src, int
               c, size_t n);
Function Variants This function also has variants named _memccpy32 and _memccpy64 for use with 32-bit and 64-bit pointer sizes, respectively. See Section 1.8 for more information on using pointer-size-specific functions.

Arguments

dest
A pointer to the location of a destination string.
src
A pointer to the location of a source string.
c
A character that you want to search for.
n
The number of charcter you want to copy.

Description

This function operates on strings in memory areas. A memory area is a group of contiguous characters bound by a count and not terminated by a null character. The function does not check for overflow of the receiving memory area. The memccpy function is defined in the <string.h> header file.

The memccpy function sequentially copies characters from the location pointed to by src into the location pointed to by dest until one of the following occurs:

Return Values
A pointer to the character following the character specified by c in the string pointed to by dest
NULL  Indicates an error. The character c is not found after scanning n characters in the string. 


Previous Page | Next Page | Table of Contents | Index