#include <stdio.h>
int main() {
char a[50] = {0};
char b[50] = {0};
int i = 0;
//将b中的字复制到a中去
/* printf("please input a!\n");
gets(a);*/
printf("please input b!\n");
gets(b);
for (int i = 0; b[i] != '\0'; i++) {
a[i] = b[i];
}
printf("%s", a); //注意
return 0;
}
注意错误:
printf("%s", a); // 此处为 数组a 对应%s