函數(shù)名: memcpy
功 能: 從源source中拷貝n個(gè)字節(jié)到目標(biāo)destin中
用 法: void *memcpy(void *destin, void *source, unsigned n);
程序例:
#include <stdio.h>
#include <string.h>
int main(void)
{
char src[] = "******************************";
char dest[] = "abcdefghijlkmnopqrstuvwxyz0123456709";
char *ptr;
printf("destination before memcpy: %s/n", dest);
ptr = memcpy(dest, src, strlen(src)); /*****目標(biāo)destin,源source,拷貝長度*****/
if (ptr) /******ptr=1*****/
printf("destination after memcpy: %s/n", dest);
else
printf("memcpy failed/n");
return 0;
}