69,368
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include<string.h>
int main()
{
char *p = "abcdefg";
char q[] = "abcdefg";
char r[] = {'a','b','c','d','e','f','g'};
printf("%d ",sizeof(p));
printf("%d\n",strlen(p));
printf("%d ",sizeof(q));
printf("%d\n",strlen(q));
printf("%d ",sizeof(r));
printf("%d\n",strlen(r));
}