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;
意法半导体笔试题目分享(软件测试)
笔墨站
人气:1.67W
更多推荐
- 1学普通话心得体会6篇 普通话学习:笔触下的华丽蜕变!
- 2杯诚信辩论赛活动策划书
- 3市领导仪式讲话稿7篇
- 4幼儿园垃圾分类主题班会教案6篇
- 5疫日沉思作文
- 6员工聘用合同怎么写8篇 《如何撰写完善的员工聘用合同》
- 7国培园长培训心得体会2篇 国培园长培训:领导力提升与职业成长的启示
- 8小学生自我介绍简单大方3篇 优秀小学生的自我介绍:简单大方,展现自我风采
- 9家教老师心得家教老师心得体会范文2篇 "智慧成长:家教老师的感悟与策略"
- 10党庆心得体会7篇
- 11远足作文600字6篇
- 122024个人述职述廉报告模板5篇
- 13本学年度述职报告教师幼儿园5篇
- 14关于大学学生会工作计划范文三篇
- 15与书的故事读后感最新5篇