高考知识网 时间:2023-08-18 19:19:12
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
#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;
root = dtree (root, h, w) ; // h and w are integers get from input
.........
}
中国点击率最高的一篇文章 !
2023-08-13 03:45:29山东大学在福建高考招生计划人数和专业代码(参考)
2024-06-08 08:59:56广州华南商贸职业学院在福建高考招生计划人数和专业代码(参考)
2024-06-08 08:56:34陕西高考610至620分左右理科可以上什么大学
2024-06-08 08:53:10湖南上东北师范大学多少分 分数线及排名
2024-06-08 08:49:38天津艺术职业学院对比安徽国防科技职业学院哪个好 附分数线排名
2024-06-08 08:46:04保定学院网络与新媒体专业怎么样?录取分数线多少分
2024-06-08 08:42:14河北新闻网两学一做知识竞赛(试题+答案完整版)
2023-08-13 23:55:25河北新闻网两学一做知识竞赛活动试题答案
2023-08-14 04:06:25两学一做学习教育知识竞赛活动10篇
2023-08-21 12:22:13律师事务所律师笔试题和面试题答案
2023-08-20 03:05:03施奈德笔试题和面试题答案目
2023-08-17 20:12:00税法类的笔试题和面试题答案目
2023-08-25 14:08:20