![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
#include <stdio.h>
#include <string.h>
int main()
{
char a[5] = "ABCD";
char b[8] = "abcdefg";
char c[8] = "abcdefg";
char d[5] = "ABCD";
strcpy(a,b); //长的复制给短的
strcpy(c,d);//短的复制给长的
printf("%d\n",strlen(a));//a的长度直接增加了
printf("%s\n",a);
printf("%s\n",c);
}