若有定义char s[] = {“hello”};则sizeof(s)的大小为5。
错
举一反三
内容
- 0
若有定义:char s[20]= "abcdef"; 则strlen(s) 的值为20。
- 1
若有定义char s[5] = { 'h', 'e', 'l', 'l', 'o' };则printf(“%s”,s);的输出结果为( ) A: h B: 输出数组s的地址 C: 输出字符串hello后乱码 D: hello
- 2
若有定义和语句: char s[10]:s="abcd";printf("%s\n",s);则输出结果是______ 。
- 3
设有定义:char s[12] = "string"; 则printf("%d\n ", sizeof(s)); 的输出是【 】.
- 4
设变量定义为 char s[ ]="book",则s中有5个元素。