2015年嵌入式系统开发工程师模拟真题
来源:才华咖 本文已影响2.56W人
来源:才华咖 本文已影响2.56W人
一.分析题。
本题(各5分)。假设下面代码中的`变量都是合法变量,调用外部的函数都是正确的。回答几个问题:
这些代码意图要干什么?
是否有问题?
如果有问题,该如何修改,或者如何避免类似错误发生?
如果没有问题,如果代码有输出,输出是什么?
1、———————————————————–
int isvowel (char c)
{
return c==’a’’’’’’’’||c==’e’’’’’’’’||c==’i’’’’’’’’||c==’o’’’’’’’’||c==’u’’’’
}
2、———————————————————–
while (c==’t’||c=’ ‘||c==’n’)
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(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) {
putchar(’-’’’’’’’’);
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);
}
2017嵌入式系统开发工程师考试模拟试题
2017嵌入式系统开发工程师考试仿真题
2016年计算机四级嵌入式系统开发工程师模拟试题
嵌入式系统开发工程师模拟试题2016
嵌入式系统开发工程师模拟试题
2015《嵌入式系统开发工程师》面试模拟题
2015最新嵌入式系统开发工程师模拟试题
2017计算机四级嵌入式系统开发工程师模拟试题
2015计算机四级嵌入式系统开发工程师模拟试题
历年计算机四级嵌入式系统开发工程师模拟题
2017嵌入式系统开发工程师知识点:嵌入式系统简介
2017年计算机四级嵌入式系统开发工程师模拟试题
2017嵌入式系统开发工程师考试模拟题
2016年3月嵌入式系统开发工程师模拟试题
2016最新嵌入式系统开发工程师模拟试题
2017嵌入式系统开发工程师考试复习要点
2017年9月计算机四级嵌入式系统开发工程师考前指导试题
2015下半年全国计算机四级《嵌入式系统开发工程师》练习题及答案
嵌入式开发工程师简历模板
2016计算机四级《嵌入式系统开发工程师》试题及答案
2017计算机四级嵌入式系统开发工程师基础习题及答案
2016年嵌入式系统开发工程师考试复习要点汇总
2017年计算机四级嵌入式系统开发工程师考点复习
2015计算机三级《嵌入式系统开发技术》模拟试题
嵌入式系统软件工程师岗位职责
计算机四级嵌入式系统开发工程师模考练习题
2017年嵌入式系统开发工程师考试试题及答案
2017嵌入式系统开发工程师考试复习知识点
《嵌入式系统工程训练》课程设计报告
2017嵌入式系统开发工程师考试重要知识点
嵌入式系统开发工程师考试复习要点2017
计算机四级嵌入式系统开发工程师模考试题
计算机嵌入式系统开发工程师考试试题2017
2017计算机四级嵌入式系统开发工程师强化习题及答案
2017计算机三级嵌入式系统开发技术模拟试题及答案
2017年计算机四级嵌入式系统开发工程师练习试题
2017嵌入式系统开发工程师考试模拟题
2017嵌入式系统开发工程师考试知识点
2015年计算机三级考试嵌入式系统开发技术模拟试题(含答案)
2015年计算机三级《嵌入式系统开发技术》模拟试题及答案