意法半导体软件测试笔试题分享
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
1. In a runtime C program, auto variables are stored in , static variables 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;
root = dtree (root, h, w) ; // h and w are integers get from input
.........
}
-
遵义医学院2015年考研复试时间及复试相关通知发布
2015年硕士研究生复试分数线已划定,一志愿考生初试成绩达到国家二类分数线,可获得参加我校研究生复试资格。我校不再单独寄发复试通知书,请名单内考生按规定时间到校办理复试报到手续。遵义本地考生3月24日上午凭身份证到研究生院办公室于老师处领取复试通知书;外...
-
考研案例:失败是坚忍的最后考验
考研结束了。有人成功,有人落马,和考上了这个连念一遍都觉得喜气洋洋的词语相对,考研失败这个词,即便在舌头上滚一圈,也会立刻让人感到头皮发麻、心惊肉跳。的确,失败的痛苦会在考研人的身上碾过,但从头再来依然是提及率最高的词汇,充满了勇气。事实上,无论别人告诉你什...
-
2015考研英语复习:背题背文不可少
不可否认考研英语重在单词与语法,这两大要素最难积累,这也正是英语学渣难以短时间赶超学霸的根本原因。但我们若想学渣翻身做学霸的话,还得从单词和语法入手。以下是新东方在线全国研究生入学考试研究中心教研老师对考研英语复习备考的方法介绍。都是当年考过研的...
-
2011年考研法硕非法学联考综合课试题答案
随着2017考研的到来,考生们都在积极复习备考了。下面是小编为大家整理收集的关于2011年考研法硕非法学联考综合课试题答案的相关内容,希望对大家有所帮助。一、单项选择题:每小题1分,共45分。1.C2.C3.A4.B5.D6.B7.C8.B9.B10.B11.B12.C13.D14.A15.D16.A17.C18.B19.A20.D21.B22.A23.D24.B25.A2...