1、若定义:char s[][]= {}, *p = (char *)s;那么下列表达式语法正确,并且其值与 s[][]相等的表达式(并非一定与其等价)是( )。(2分)
A. *(s+3)
B. *++p+2
C. *s+2
D. p[1][1]
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-7c79-c0d6-3f0ad517a300.html
点击查看答案
1、地址是指( )。(2分)
A. 变量的类型
B. 变量的值
C. 变量所在的内存单元编号
D. 变量本身
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-e2ec-c0d6-3f0ad517a300.html
点击查看答案
1、对于以下代码:int i;for(i=0; i<10; i++)printf( );for循环后,i的值是( )。(2分)
A. 9
B. i不存在
C. 10
D. i没有确定的值
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-9abb-c0d6-3f0ad517a300.html
点击查看答案
1、如有定义语句int a,b; double x; 则下列选项中没有错误的是( )。提示:(int)x 表示将变量x的值强制转换成int类型。若x初始值为3.2则(int)x的结果是int类型,值为3。(2分)
A. switch(x%2) {case 0: a++; break;case 1: b++; break;default: a++; b++;}
B. switch((int)x%2 ) {case 0: a++; break;case 1: b++; break;default: a++; b++;}
C. switch(x%2) {case 0: a++; break;case 1.0: b++; break;default: a++; b++;}
D. switch((int)x%2.0) {case 0: a++; break;case 1: b++; break;default: a++; b++;}
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-38d9-c0d6-3f0ad517a300.html
点击查看答案
1、在一个链表中,要把s所指的一个结点插入到p所指的一个结点后面去,正确的代码段是( )。(2分)
A. s->next = p;p->next = s;
B. s->next = p->next;p = s;
C. p->next = s;s->next = p;
D. s->next = p->next;p->next = s;
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-5f71-c0d6-3f0ad517a300.html
点击查看答案
1、循环语句while (!x && !y)中的循环条件表达式等价于( )。(2分)
A. x=0 && y=0
B. !(x|| y)
C. !(x == 0 || y == 0)
D. !(x == 0 && y == 0)
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-8e06-c0d6-3f0ad517a300.html
点击查看答案
1、以下不能正确进行字符串初始化的是( )。(2分)
A. char str[8] = {'g', 'o', 'o', 'd', '!'};
B. char str[8] = "good!";
C. char *str = "good!";
D. char str[] = {'g', 'o', 'o', 'd', '!'};
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-b7dd-c0d6-3f0ad517a300.html
点击查看答案
1、若有:int a[] = {}, *p = &a[], i; 其中0≤i≤9,则对a数组元素不正确的引用是( )。(2分)
A. p[i]
B. *p
C. a[10]
D. *(&a[i])
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-1207-c0d6-3f0ad517a300.html
点击查看答案
1、使用malloc()向系统动态申请内存时,正确的是( )。(2分)
A. 分配的内存空间只能使用一个特定的指针访问
B. 总是能获得一个指向所需内存空间首地址的指针
C. 分配的内存空间不用时系统会自动收回
D. 有可能获得空指针
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c2-3ac7-c0d6-3f0ad517a300.html
点击查看答案
1、对于int x, y;语句if(x < 0)y = -1;else if(!x)y = 0;elsey = 1;等价于( )。(2分)
A. y = 0;if(x != 0)if(x > 0)y = 1;elsey = -1;
B. y = 0;if (x >= 0)if(x)y = 1;elsey = -1;
C. if(x >= 0)y = 0;if(x)y = 1;elsey = -1;
D. if(x != 0)if(x > 0)y = 1;elsey = -1;
https://www.shititong.cn/cha-kan/shiti/0001a7aa-d8c1-32ac-c0d6-3f0ad517a300.html
点击查看答案