社区应用 最新帖子 精华区 社区服务 会员列表 统计排行 社区论坛任务 迷你宠物
  • 3007阅读
  • 0回复

[笔试]意法半导体软件试题

级别: 经院本科
发帖
1586
铜板
2193
人品值
2089
贡献值
15
交易币
0
好评度
1575
信誉值
0
金币
0
所在楼道
全球第三、欧洲第一的大半导体企业——意法半导体软件试题 

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) sub-nodes. 
Please 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 
......... 


评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
描述
快速回复

您目前还是游客,请 登录注册
如果您在写长篇帖子又不马上发表,建议存为草稿
认证码:
验证问题:
10+5=?,请输入中文答案:十五