函数名: memccpy
功 能: 从源source中拷贝n个字节到目标destin中
用 法: #include <stdio.h>
void *memccpy(void *destin, void *source, unsigned char ch, unsigned n);
程序例:
#include <string.h>
#include <stdio.h>
int main(void)
{
char *src = "This is the source string";
char dest[50];
char *ptr;
ptr = memccpy(dest, src, 'c', strlen(src));
if (ptr)
{
*ptr = '\0';
printf("The character was found: %s\n", dest);
}
else
printf("The character wasn't found\n");
return 0;
}