历年计算机四级嵌入式系统开发工程师模拟题
滴水可以穿石也是锲而不舍精神的体现。我们航行在没有边际的学习海洋上,只有凭借这种精神,才可能到达知识的彼岸,下面是小编为大家搜素整理的计算机四级考试题,希望能给大家带来帮助!更多精彩内容请及时关注我们应届毕业生考试 网!
一、分析题。本题(各5分)。
假设下面代码中的变量都是合法变量,调用外部的`函数都是正确的。回答几个问题:
这些代码意图要干什么?
是否有问题?
如果有问题,该如何修改,或者如何避免类似错误发生?
如果没有问题,如果代码有输出,输出是什么?
1、———————————————————–
int isvowel (char c)
{
return c==’a’’’’’’’’||c==’e’’’’’’’’||c==’i’’’’’’’’||c==’o’’’’’’’’||c==’u’’’’
}
2、———————————————————–
while (c==’ ’||c=’ ‘||c==’’)
c=getc(f);
3、———————————————————–
/* 当x=2, y=3, z=? */
if (x==0)
if (y==0)
z=-1;
else
z=x+y;
4、———————————————————–
/* 处理网络事件 */
void process_network_code(int x, int y)
{
/* 选择modes_pointer资源 */
switch (line) {
case THING1:
/* 处理异常1#, 使用老的modes_pointer资源 */
doit1();
break;
case THING2:
/* 处理异常2#, 需要重新启动服务 */
if (x == STUFF) {
/* 重新申请modes_pointer资源,没有初始化 */
do_first_stuff();
/* 在这种条件下,有些资源不用重新申请 */
if (y == OTHER_STUFF)
break;
/* 申请剩下的资源,并初始化 */
do_later_stuff();
}
/* 初始化modes_pointer资源 */
initialize_modes_pointer();
break;
default:
/* 处理普通事件, 使用老的modes_pointer资源 */
processing();
}
/* 使用modes_pointer资源,处理事件 */
use_modes_pointer();
}
5、———————————————————–
int is_gb2312_char c1, char c2)
{
if (c1 >= 0xa1 && c2 >= 0xa1)
return 1;
else
return 0;
}
6、———————————————————–
下面x, y的值是多少,有什么问题?
int x = 10, y = 3;
x ^= y;
y ^= x;
x ^= y;
/* x=?, y = ? */
7、———————————————————–
int days[]={31,28,31,30,31,30,31,31,30,31,30,31,};
int calendar[12][31];
int (*monthp)[31];
int *dayp;
int i;
memset(calendar, 0, sizeof(calendar));
i = 0;
for (monthp = calendar; monthp < &calendar[12]; monthp++) {
for (dayp = *monthp; dayp < &(*monthp)[31]; dayp++) {
if (dayp - *monthp < days[calendar - monthp]) {
*dayp = i++ % 7 + 1;
}
}
}
8、———————————————————–
void printnum(long n)
{
if (n < 0) {
put’-’’’’’’’’);
n = -n;
}
if (n >= 10) {
printnum(n/10);
}
putchar (”0123456789″[n%10]);
}
9、———————————————————–
void * memchr(void *pv, unsigned char ch, size_t size)
{
unsigned char *pch = (unsigned char *) pv;
unsigned char *pchEnd = pch + size;
while (pch < pchEnd) {
if (*pch == ch)
return (pch);
pch++;
}
return NULL;
}
10、———————————————————–
void * memchr(void *pv, unsigned char ch, size_t size)
{
unsigned char *pch = (unsigned char *) pv;
unsigned char *pchPlant = pch + size;
unsigned char chSave = *pchPlant;
*pchPlant = ch;
while (pch != ch) {
pch++;
}
*pchPlant = chSave;
return ((pch == pchPlant) ? NULL : pch);
}
-
计算机考试四级模拟试题2016
距离2016年上半年计算机考试越来越近了,小编特地为大家提供了计算机四级考试的模拟题及答案,希望能为大家提供帮助!1)或非门的输入变量为X1和X2,输出变量为Y,使输出变量Y为1的X1和X2的值是A)0,0B)0,1C)1,0D)1,12)若二进制数原码为-0.0101,则其补码为A)-0.0101B)0.0101C)...
-
计算机四级网络工程师操作系统单选题试卷
四级考试科目由五门专业基础课程中指定的两门课程组成,总分100分,两门课程各占50分。这是小编提供的计算机四级网络工程师操作系统单选题试卷,快来看看吧。1在进行操作系统设计时,下列哪一个是构造操作系统的方法?A.网络式结构B.并行式结构C.微内核结构D.主从式结...
-
9月全国计算机等级考试四级数据库工程师笔试真题及答案
一、选择题(1)视图是数据库中的重要对象,下列有关视图的说法错误的是A)一般情况下,数据库只存储视图的定义,其数据仍存放在相关的基本表中B)可以将复杂的查询语句封装在视图中以简化相关查询语句的编写C)通过视图可以屏蔽不希望用户看到的敏感数据,提高数据库数据...
-
计算机等级考试四级经典论述题介绍
导语:计算机等级考试四级对于论述题你是否掌握了它的考试要点呢?下面就由小编为大家带来计算机等级考试四级经典论述题介绍,希望能给大家带来帮助!第一部分基本概念问题一:⑴试述操作系统的概念,作用,特征⑵基本的操作系统类型有哪些?操作系统的目标是什么?有哪些主要特...