程序中的字符数组`st`被初始化为`"hello\0\t\\\"`。分析转义字符:- `hello`占5个字符。- `\0`是空字符,作为字符串结束符,位于第5位。- 后续的`\t`(制表符)和`\\`(转义反斜杠)等字符位于空字符后,但`strlen`会在遇到`\0`时停止计数,因此`strlen(st)`输出5。- `sizeof(st)`计算数组总大小...
The sizeof keyword gives the amount of storage, in bytes, associated with a variable or a type(including aggregate types). This keyword returns a value of type size_t. strlen 所作的仅仅是一个计数器的工作,它从内存的某个位置(可以是字符串开头,中间某个位置,甚至是某个不确定的内存区域)开始扫...
我有道C语言题目~有兴趣请做做~以下程序的输出结果是( ).main(){ char st[20]= “hello\0\t\\\”;printf(%d %d \n”,strlen(st),sizeof(st));A) 9 9 B) 5 20 C) 13 20 D) 20 20
百度试题 结果1 题目7.下面程序段的输出结果是()。char c[]="\t\v\\\Owill\n";printf("d, td", strlen(c) , sizeof(c)); A. 2,14 B. 9,14 C. 3,10 D. 6,10 相关知识点: 试题来源: 解析 C 反馈 收藏
以下程序的输出结果是 ___。 main() { char st[20]="hello'、0\t\\"; printf("%d%d\n",strlen(st),sizeof(st)); }A.99 B.520 C.1320 D.2020答案 查看答案发布时间:2022-05-10 更多“以下程序的输出结果是 ___。main(){char st[20]="hello'、0\t\\"; printf("%d%d\n",strlen(st)...
写出以下程序运行后的输出结果。#include"stdio.h"#include"string.h"intmain(){charst[20]={"hello\0\t\\\""};printf("%d,%d",strlen(st),sizeof(st));return0;} 参考答案:第一空: 5,20;5,20 点击查看答案进入小程序搜题你可能喜欢4月份生产合格品25件,料废品5件,加工失误产生废品2件,计价单价...