试题题干
设chars[10]=”peace”;,执行语句printf(“%d\n”,strlen(s));后输出的结果是。
参考答案
试题解析
函数strlen()的返回值是字符串的实际长度。”peace”字符串的长度为5,所以执行语句printf(“%d\n”,strlen(s));后输出的结果是5。
设chars[10]=”peace”;,执行语句printf(“%d\n”,strlen(s));后输出的结果是。
函数strlen()的返回值是字符串的实际长度。”peace”字符串的长度为5,所以执行语句printf(“%d\n”,strlen(s));后输出的结果是5。