意法半导体笔试题
A Test for The C Programming Language
I. History
1. C was originally designed for and implemented on the (what) operating system on the DEC PDP-11, by (who) .
2. The most recently approved ANSI/ISO C standard was issued in (when), and single line comments notation “//” is or isn’t a feature of C89.
II. Syntax and Semantics a runtime C program, auto variables are stored in , staticvariables are stored in , and function parameters are stored in .
a. stack b. heap c. neither stack nor heap
2. The statement “extern int x;” is a , and the keyword extern is used during .
a. variable declaration b. variable definition c. compilation time d. runtime
3. There is a complicated declaration: void ( * signal (int, void(*)(int)) ) (int);If a statement “typedef void (*p) (int);” is given,please rewrite this complicated declaration.
4. The following code is a segment of C program.
..........
void func(int *p)
{...........}
..........
main()
{
int num=0;
.........
func(&num);
........
}
..........
Here, the function argument “&num” is passed .
a. by value b. by reference
III. Practice
Create a tree, which has h (h>0) layers, and its each node has w(w>0) se complete the following incomplete solution.
#include
#include
struct tree{
char info;
p_sub; //link to sub-nodes};
// allocate memory and initiate
void dnode ( struct tree* tmp )
{
= malloc( sizeof (struct tree) );
= 0x41;
= NULL;
}
struct tree *dtree (struct tree* subtree, int height, int width)
{
int i;
if ( !subtree ) //if necessary, allocte memory for subtree
denode(subtree);
if ( height == 1 )
return subtree;
else if ( height == 2 ) {
struct tree *leaf = NULL;
for ( i=0; i
denode ( );
;
leaf = NULL;}
return subtree;}
else {
for ( i=0; i
}
return subtree;
}
}
main()
{
.........
struct tree *root = NULL;
-
2015考研大纲公布前政治复习九大建议
2015考研复习已开始,关于新大纲是否变化还言之过早,现阶段应该踏实地看看基本的考点。因为,就政治来说,动大手术的可能性不太大,但这并不是说没有变化,一些考点的增删,语言表述的调整等等都会出现。有些考生非要等到大纲出来后再开始学习,这大可不必。出来之前应该已经...
-
2016年考研《英语一》完型填空答案
随着2017考研的到来,考生们都在积极备考了。下面是小编为大家整理收集的关于2016年考研《英语一》完型填空答案的相关内容,仅供大家参考。1.[标准答案][D]aswellas[考点分析]本题考察逻辑关系[选项分析]因为考察逻辑关系,所以需要我们先对填空前后的原文信息做定...
-
华南理工大学2015考研复试分数线
2015华南理工大学考研复试分数线公布。本站考研网第一时间公布2015考研复试线,敬请关注!各位考生:经学校研究生招生领导小组研究决定,现将我校2015年硕士研究生复试最低分数线予以公布(见附件)。我校复试工作将于3月16日开始,具体时间由相关学院确定。现将相关事项...
-
2016考研时间无法充值:8个问题要及时解决
考研成绩要想好,行为习惯少不了。观察这几年的考研成绩,我们会发现,一个考研成绩好的学生,他/她为考研所采取的行为和习惯是最终让他/她取得好成绩的重要因素。印度谚语说:播种一种行为,收获一种习惯;播种一种习惯,收获一种性格;播种一种性格,收获一种命运。既然选...