View Code
#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);
}

相关文章:

  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2021-12-06
  • 2022-01-11
  • 2021-04-30
  • 2022-01-09
猜你喜欢
  • 2021-08-01
  • 2022-12-23
  • 2022-02-24
  • 2022-01-10
  • 2022-12-23
  • 2021-08-28
  • 2021-11-27
相关资源
相似解决方案