C语言学习(10)
1 //char s1[100],s2[]="How are you!" 2 //s1=s2;错误!因为s1表示数组的第0个元素的地址,它为常量,不能被赋值 3 #include <stdio.h> 4 #include <string.h> 5 int main(){ 6 char s1[100],s2[]="How are you"; 7 strcpy(s1,s2); 8 puts(s1); 9 strcpy(s1,"I am fine"); 10 puts(s1); 11 return 0; 12 }
posted on 2018-06-27 18:42 孙悟空son_ku_kong 阅读(103) 评论(0) 编辑 收藏 举报