作业帮 > 综合 > 作业

#include main() { char *p="abcde\ofghjik\0"; printf("%d\n",s

来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/05/24 14:29:18
#include main() { char *p="abcde\ofghjik\0"; printf("%d\n",strlen(p)); }
#include
main()
{ char *p="abcde\ofghjik\0";
printf("%d\n",strlen(p));
}程序运行后输出结果是
a12 b15 c6 d5
#include main() { char *p=
a 12
abcde\ofghjik\0
共有12个字符
a,b,c,d,e,\o,f,g,h,j,i,k(‘\o'转义字符,表示空字符(NULL)’)
最后的'\0'为结束符,不算做字符串长度之内