void arrCopy( char arr1[], char arr2[]){
if(sizeof(*arr1)/sizeof(char<sizeof(*arr2)/sizeof(char)){
printf(""input error.");
return;}
else{int i=0;
for(;arr2[i]!='\0',i++){
arr1[i]=arr2[i];}
arr1[i]='\0';return;}
#include<stdio.h>
int main(){
char arr[2];
char arrAft="北京欢迎您!";
printf("arr为%s\n",arr);
return 0;
}
}
} |
|