问题
单项选择题
有以下程序: #include<string.h> main( ) { char *p="abcde\0ghjik\0"; printf("%d\n",strlen(p) ); } 程序运行后的输出结果是( )。
A.12
B.15
C.6
D.5
答案
参考答案:D
解析:字符'\0'为字符串结束标识位。
有以下程序: #include<string.h> main( ) { char *p="abcde\0ghjik\0"; printf("%d\n",strlen(p) ); } 程序运行后的输出结果是( )。
A.12
B.15
C.6
D.5
参考答案:D
解析:字符'\0'为字符串结束标识位。