意法半导体笔试题和面试题答案 意法半导体笔试题和面试题答案
创始人
2026-09-05 05:41:01

  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 , staticvariables 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

相关内容

热门资讯

外墙外保温工程量计算方法 1、 null2、 对于整体墙面保温,按墙面长度乘以高度计算总面积,再扣除门窗及面积超过0.3平方米...
青岛一男子跟风“网红”野路爬山... 网上走红的野路徒步路线千万不要盲目跟风冒险!9月2日青岛西海岸小珠山发生一起意外险情:青岛一名男子轻...
名师示范课开讲啦! 在第42个教师节来临之际,为大力弘扬教育家精神,共筑尊师重教风尚,增强学校教师爱教兴教强教的信心和本...
是什么让“龙餐馆外交”刺痛西方... 导读:世界早已厌倦西方高高在上的价值说教。绝大部分国家真正关心的问题其实很具体。道路能不能修起来,港...
受台风“沙德尔”影响 福建转移... 本文转自【央视新闻客户端】;记者从福建省防汛抗旱指挥部了解到,应对台风“沙德尔”和持续性强降雨,截至...