sizeof() 会统计末尾的’\0’,strlen不会统计
sizeof看这个数据结构占用空间大小,strlen只看字符有几个
#include <stdlib.h>
#include <string.h>
int main()
{
char source[] = "Hello,world!";
char destination[10];
printf("%d\n",sizeof(destination));//10
printf("%d\n",sizeof(source));//13
printf("%d\n",strlen(destination));//0
printf("%d\n",strlen(source));//12
return(0);
}```