//7.把int arr[4]={65,66,67,68};转换成一个字符数组char arr[4]
#include <stdio.h>
int main(){
int arr[4]={65,66,67,68};
char arr1[4];
for (int i=0; i<4; i++) {//给arr1赋值
arr1[i]=arr[i];
}
for (int i=0; i<4; i++) {
printf("%c",arr1[i]);
}
printf("\n");
return 0;
} |
|