意法半导体笔试题目分享
考研1.35W
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 <stdlib.h>
#include <string.h>
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<width; i++ ) {
denode ( );
;
leaf = NULL;}
return subtree;}
else {
for ( i=0; i<width; i++ ) {
}
return subtree;
}
}
main()
{
.........
struct tree *root = NULL;
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 <stdlib.h>
#include <string.h>
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<width; i++ ) {
denode ( );
;
leaf = NULL;}
return subtree;}
else {
for ( i=0; i<width; i++ ) {
}
return subtree;
}
}
main()
{
.........
struct tree *root = NULL;
-
凭靠五点取胜2015考研盛夏
本站考研网小编为大家整理了暑期复习的目标,虽然在各自不同的地方复习着,但是这个暑期你们只属于考研,这个暑期你们有一个共同的名字,叫做考研人!加油!你凭什么熬过承载2015考研的盛夏2013年考研报名人数高达176万,录取人数只有53.9万,报录比为3.3:1,谁是最后3.3人中...
-
考研心声:相信自己 坚定前行
从小就有读研的梦想,从短期来看,我觉得读研能够多享受一段时间学生时光,同时缓解缓解就业的压力;从长远来说我觉得可以丰富我的经历,增长见识。我在本科院校就读时,学习成绩比较靠前,是有资格申请一个保送名额的。但是我想读一个更好一点的院校,所以选择了考研,最后由...
-
山东大学2015考研现场确认公告
山东大学(ShandongUniversity),简称山大,是中华人民共和国教育部直属的一所拥有全部12大学科门类的综合性全国重点大学,是国家211工程、985工程重点建设院校,入选111计划、珠峰计划、卓越工程师教育培养计划、卓越医生教育培养计划、卓越法律人才教育培养计划,中管...
-
2016年中国计量大学715综合课1考研真题
随着考研的到来,考生们在积极寻找各院校的考研真题了。下面是小编为大家整理收集的关于2016年中国计量大学715综合课1考研真题的相关内容,希望对大家有所帮助。一、名词解释(每小题5分,共30分)1、金融调控2、市场准入3、消费者权益4、行政性垄断行为5、产品6、WTO...