void Func(char str_arg[100])
{
printf("%d\n", sizeof(str_arg));
}
int main(void)
{
char str[] = "Hello";
printf("%d\n", sizeof(str));
printf("%d\n", strlen(str));
char *p = str;
printf("%d\n", sizeof(p));
Func(str);
return 0;
}
运行结果为:6 5 4 4
sizeof 是包括字符串的’\0’
strlen 则是当前有效的字符数量