#include <stdio.h>
void data_copy ( const int data[], int copy_data[], int len );
int main(void) {
int n1[5]={1,2,3,4,5};
int n2[5]={6,7,8,9,10};
int n3[20]={0};
int l=sizeof(n1)/sizeof(n1[0]);
data_copy(n1,n2,l);
for(int i=0;i<l;i++){
printf("copy_data[%d]=%d\n",i
,n2
[i
]); }
return 0;
}
void data_copy(const int data[],int copy_data[],int len){
for(int i=0;i<len;i++){
copy_data[i]=data[i];
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+CnZvaWQgZGF0YV9jb3B5ICggY29uc3QgaW50IGRhdGFbXSwgaW50IGNvcHlfZGF0YVtdLCBpbnQgbGVuICk7CgppbnQgbWFpbih2b2lkKSB7CglpbnQgbjFbNV09ezEsMiwzLDQsNX07CglpbnQgbjJbNV09ezYsNyw4LDksMTB9OwoJaW50IG4zWzIwXT17MH07CglpbnQgbD1zaXplb2YobjEpL3NpemVvZihuMVswXSk7CglkYXRhX2NvcHkobjEsbjIsbCk7Cglmb3IoaW50IGk9MDtpPGw7aSsrKXsKCQlwcmludGYoImNvcHlfZGF0YVslZF09JWRcbiIsaSxuMltpXSk7Cgl9CglyZXR1cm4gMDsKfQp2b2lkIGRhdGFfY29weShjb25zdCBpbnQgZGF0YVtdLGludCBjb3B5X2RhdGFbXSxpbnQgbGVuKXsKCWZvcihpbnQgaT0wO2k8bGVuO2krKyl7CgkJY29weV9kYXRhW2ldPWRhdGFbaV07Cgl9Cn0K