<delect id="sj01t"></delect>
  1. <em id="sj01t"><label id="sj01t"></label></em>
  2. <div id="sj01t"></div>
    1. <em id="sj01t"></em>

            <div id="sj01t"></div>

            中興c語言筆試題

            時間:2024-09-25 13:40:42 面試筆試 我要投稿
            • 相關推薦

            中興c語言筆試題

              導語:C語言在編程語言中具有舉足輕重的地位,不少企業對員工要求會c語言,好比華為、中興……,通常他們會要求筆試,比較他們的理論水平。對于有意向的學生、社工來說,提前了解下他們的筆試能為你在求職上帶來助力。下面是小編收集的中興c語言筆試題,希望能為你帶來幫助。

            中興c語言筆試題

              一、請填寫BOOL , float, 指針變量 與“零值”比較的 if 語句。(10分)

              提示:這里“零值”可以是0, 0.0 , FALSE或者“空指針”。例如 int 變量 n 與“零值”比較的 if 語句為:

              if ( n == 0 )

              if ( n != 0 )

              以此類推。

              請寫出 BOOL flag 與“零值”比較的 if 語句:

              請寫出 float x 與“零值”比較的 if 語句:

              請寫出 char *p 與“零值”比較的 if 語句:

              二、以下為Windows NT下的32位C++程序,請計算sizeof的值(10分)

              char str[] = “Hello” ;

              char *p = str ;

              int n = 10;

              請計算

              sizeof (str ) =

              sizeof ( p ) =

              sizeof ( n ) =

              void Func ( char str[100])

              {

              請計算

              sizeof( str ) =

              }

              void *p = malloc( 100 );

              請計算

              sizeof ( p ) =

              三、簡答題(25分)

              1、頭文件中的 ifndef/define/endif 干什么用?

              2、#include和 #include “filename.h” 有什么區別?

              3、const 有什么用途?(請至少說明兩種)

              4、在C++ 程序中調用被 C編譯器編譯后的函數,為什么要加 extern “C”聲明?

              5、請簡述以下兩個for循環的優缺點

              // 第一個

              for (i=0; i<n; p="" i++)<="">

              {

              if (condition)

              DoSomething();

              else

              DoOtherthing();

              }

              // 第二個

              if (condition)

              {

              for (i=0; i<n; p="" i++)<="">

              DoSomething();

              }

              else

              {

              for (i=0; i<n; p="" i++)<="">

              DoOtherthing();

              }

              優點:

              缺點:

              優點:

              缺點:

              四、有關內存的思考題(20分)

              void GetMemory(char *p)

              {

              p = (char *)malloc(100);

              }

              void Test(void)

              {

              char *str = NULL;

              GetMemory(str);

              strcpy(str, "hello world");

              printf(str);

              }

              請問運行Test函數會有什么樣的結果?

              答:

              char *GetMemory(void)

              {

              char p[] = "hello world";

              return p;

              }

              void Test(void)

              {

              char *str = NULL;

              str = GetMemory();

              printf(str);

              }

              請問運行Test函數會有什么樣的結果?

              答:

              Void GetMemory2(char **p, int num)

              {

              *p = (char *)malloc(num);

              }

              void Test(void)

              {

              char *str = NULL;

              GetMemory(&str, 100);

              strcpy(str, "hello");

              printf(str);

              }

              請問運行Test函數會有什么樣的結果?

              答:

              void Test(void)

              {

              char *str = (char *) malloc(100);

              strcpy(str, “hello”);

              free(str);

              if(str != NULL)

              {

              strcpy(str, “world”);

              printf(str);

              }

              }

              請問運行Test函數會有什么樣的結果?

              答:

            【中興c語言筆試題】相關文章:

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

            中興通訊南京筆試題02-18

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

            中興筆試+面試題目11-21

            普天C++筆試題02-18

            中興09天津硬件筆試題目分享11-21

            群碩筆試題Java和C++、C#11-21

            中興面試筆試10-26

            C++工程師筆試題目11-25

            UC(優視科技)2014實習筆試題回憶版 C/C++編程11-21

            <delect id="sj01t"></delect>
            1. <em id="sj01t"><label id="sj01t"></label></em>
            2. <div id="sj01t"></div>
              1. <em id="sj01t"></em>

                      <div id="sj01t"></div>
                      黄色视频在线观看