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
.........
}
金山職業技術學院對比四川汽車職業技術學院哪個好 附分..
時間:2025-05-22 09:08:12成都銀杏酒店管理學院在重慶高考招生計劃人數和專業代..
時間:2025-05-22 09:05:01四川上山東理工大學多少分 分數線及排名
時間:2025-05-22 09:01:18江西高考理科533分排名多少 排名多少位次
時間:2025-05-22 08:57:21大連東軟信息學院對比甘肅民族師范學院哪個好 附分數線..
時間:2025-05-22 08:53:39廣東高考455至460分左右物理可以上什么大學
時間:2025-05-22 08:49:52
中國點擊率最高的一篇文章 !2023-08-13 03:45:29
海南上長春工業大學多少分 分數線及排名2025-05-22 09:28:45
科爾沁藝術職業學院對比山東水利職業學院哪個好 附分數線排名2025-05-22 09:25:00
呼和浩特職業學院對比山西警官職業學院哪個好 附分數線排名2025-05-22 09:22:04
四川工程職業技術學院在上海高考招生計劃人數和專業代碼(參考)2025-05-22 09:19:52
泰山科技學院對比西安理工大學高科學院哪個好 附分數線排名2025-05-22 09:16:28
江西航空職業技術學院在云南高考招生計劃人數和專業代碼(參考)2025-05-22 09:13:20
遼寧特殊教育師范高等專科學校對比江西工商職業技術學院哪個好 附分數線排名2025-05-22 09:10:51
律師事務所律師筆試題和面試題答案2023-08-20 03:05:03
施奈德筆試題和面試題答案目2023-08-17 20:12:00
稅法類的筆試題和面試題答案目2023-08-25 14:08:20 




