<dfn id="w48us"></dfn><ul id="w48us"></ul>
  • <ul id="w48us"></ul>
  • <del id="w48us"></del>
    <ul id="w48us"></ul>
  • c語言常見筆試題總結

    時間:2023-04-05 02:30:49 筆試題目 我要投稿
    • 相關推薦

    c語言常見筆試題總結

      【1 使用宏】

    c語言常見筆試題總結

      1.1

      #ifdef NDEBUG

      #define TRACE(S) S

      #else

      #define TRACE(S) printf(“%s;\n”, #S); S

      #endif

      問:以上TRACE()宏的作用是什么?

      1.2 #error的作用?

      1.3 定義一個宏,求出給定數組中的元素的個數

      #define NELEMENTS(array) ??

      1.4 定義一個宏,求出給定結構中給定成員的偏移量

      #define OFFSET(structure, member) ??

      【2 數據聲明和定義】

      給定以下類型的變量a的定義式:

      a) An integer

      b) A pointer to an integer

      c) A pointer to a pointer to an integer

      d) An array of 10 integers

      e) An array of 10 pointers to integers

      f) A pointer to an array of 10 integers

      g) A pointer to a function that takes an integer as an argument and returns an integer

      h) An array of ten pointers to functions that take an integer argument and return an integer

      【3 復雜類型(1)】

      有如下表達式:

      char (*(*x())[])();

      請用文字描述x是什么。

      【4 復雜類型(2)】

      jmp_buf的定義:

      typedef struct _jmp_buf

      {

      REG_SET reg;

      int extra[3];

      } jmp_buf[1];

      setjmp函數的原型:

      extern int setjmp (jmp_buf __env);

      問:調用setjmp時傳遞__env的內容,還是傳遞指針?

      【5 頭文件】

      問:為什么標準頭文件都有類似以下的結構?

      #ifndef __INCvxWorksh

      #define __INCvxWorksh

      #ifdef __cplusplus

      extern “C” {

      #endif

      /*…*/

      #ifdef __cplusplus

      }

      #endif

      #endif /* __INCvxWorksh */

      【6 static關鍵字】

      請說出static關鍵字的3種用處:

      (1)用于全局變量;

      (2)用于局部變量;

      (3)用于函數。

      /* file.c */

      static int a;

      int b;

      static int fn()

      {

      static int x;

      int y;

      }

      【7 const關鍵字】

      7.1 const關鍵字的意義是什么?

      7.2 解釋以下的變量定義:

      const int a1;

      int const a2;

      const int *a3;

      int * const a4;

      int const * const a5;

      【8 volatile關鍵字】

      8.1 volatile意義?例如

      volatile int *p;

      8.2 volatile能和const一起使用嗎?例如

      volatile const int *p;

      【9 sizeof()】

      有以下定義:

      char *pmsg = “A”;

      char msg[] = “A”;

      char ch = ‘A’;

      問:

      sizeof(pmsg) = ?

      sizeof(msg) = ?

      sizeof(“A”) = ?

      sizeof(ch) = ?

      sizeof(‘A’) = ? (在C++中等于多少?)

      void f(char param[100])

      {

      // sizeof(param) = ?

      }

      【10 字符串】

      有以下代碼

      char *pmsg = “hello, world!”;

      strcpy(pmsg, “hi, there.”);

      試評論該代碼。

      【11 混合運算】

      有以下代碼:

      void foo()

      {

      unsigned int a = 6;

      int b = -20;

      (a+b > 6) ? puts(“> 6″) : puts(” < = 6″);

      }

      請問調用foo()的輸出?

      【12 內存訪問】

      有以下代碼:

      void fn()

      {

      int a[100];

      int *p;

      p = (int *)((unsigned int)a + 1);

      printf(“p=0x%x\n”, *p);

      }

      試評論以上代碼。

      【13 C庫函數】

      請說明以下函數的意義:

      void perror(const char *__s);

      fdprintf(int, const char *, …);

      isspace(), isxdigit(), strerr(), sprintf()

    【c語言常見筆試題總結】相關文章:

    C/C++程序員必備資料 常見筆面試題深入解析12-12

    華為C語言筆試題12-12

    華為筆試題(C語言)12-10

    基礎C++/C語言筆試題分享11-21

    yahoo在線筆試題(c語言)12-12

    C語言筆試試題及答案07-31

    c語言筆試題目及答案08-17

    2015C語言筆試題及答案08-08

    計算機C語言試題及答案02-25

    2017年c語言面試筆試題11-22

    主站蜘蛛池模板: 99re66热这里只有精品| 国产精品无码无卡在线播放 | 亚洲国产精品自在在线观看 | 亚洲精品国产精品乱码视色| 久久精品国产免费| 日产精品一线二线三线芒果| 久久国产精品波多野结衣AV| 精品国产网红福利在线观看| 久久er99热精品一区二区| 久久狠狠一本精品综合网| 久久久国产精品福利免费| 精品无码国产一区二区三区AV | 69国产成人综合久久精品| 四虎永久在线精品免费一区二区| 青青青国产依人精品视频| 精品人妻无码一区二区色欲产成人| 欧美精品三区| 国产精品亚洲欧美大片在线观看| 国产在线精品一区二区不卡| 久久婷婷国产综合精品| 亚洲精品高清一二区久久| 久久精品一区二区三区中文字幕 | 精品无码国产一区二区三区51安 | 日韩视频中文字幕精品偷拍| 国产成人精品久久亚洲| 久久免费国产精品一区二区| freesexvideos精品老师毛多| 亚洲AV无码成人精品区天堂| 亚洲国产精品日韩| 日韩AV毛片精品久久久| 国产综合精品久久亚洲| 欧美亚洲国产成人精品| 91精品国产91久久综合| 精品欧洲AV无码一区二区男男| 亚洲动漫精品无码av天堂| 亚洲高清国产拍精品青青草原 | 热99re久久国超精品首页| 国产精品视频久久| 精品少妇一区二区三区视频| 91麻豆精品视频在线观看| 2021最新国产精品网站|