欧美一级a看免费观看,一本在线视频在线观看,国产偷自拍对白在线视频,精品欧美一区二区在线观看

    1. <dfn id="ktbui"><var id="ktbui"></var></dfn>
    2. 您當(dāng)前位置: 唯學(xué)網(wǎng) » IT認(rèn)證培訓(xùn) » 真題專題

      Java認(rèn)證考試筆試真題精選(4)

      來源:唯學(xué)網(wǎng)•教育培訓(xùn)(www.jscs8.com)  【唯學(xué)網(wǎng) • 中國教育電子商務(wù)平臺】 加入收藏

      5. There are two int variables: a and b, don’t use “if”, “? :”, “switch”orother judgement statements, find out the biggest one of the two numbers.

      答案:( ( a + b ) + abs( a - b ) ) / 2 6. 如何打印出當(dāng)前源文件的文件名以及源文件的當(dāng)前行號?

      答案:

      cout << __FILE__ ;

      cout<<__LINE__ ;

      __FILE__和__LINE__是系統(tǒng)預(yù)定義宏,這種宏并不是在某個文件中定義的,而是由編譯器定義的。

      7. main主函數(shù)執(zhí)行完畢后,是否可能會再執(zhí)行一段代碼,給出說明?

      答案:可以,可以用_onexit 注冊一個函數(shù),它會在main 之后執(zhí)行intfn1(void), fn2(void), fn3(void), fn4 (void);

      void main( void )

      {

      String str("zhanglin");

      _onexit( fn1 );

      _onexit( fn2 );

      _onexit(fn3 );

      _onexit( fn4 );

      printf( "This is executed first.\n" );

      }

      int fn1()

      {

      printf( "next.\n" );

      return 0;

      }

      int fn2()

      {

      printf( "executed " );

      return 0;

      }

      int fn3()

      {

      printf( "is " );

      return 0;

      }

      int fn4()

      {

      printf( "This ");

      return 0;

      }

      The _onexit function is passed the address of afunction (func) to be called when the program terminates normally. Successivecalls to _onexit create a register of functions that are executed in LIFO(last-in-first-out) order. The functions passed to _onexit cannot takeparameters.

      8. 如何判斷一段程序是由C 編譯程序還是由C++編譯程序編譯的?

      答案:

      #ifdef __cplusplus

      cout<<"c++";

      #else

      cout<<"c";

      #endif

      0% (0)
      0% (10)
      已有條評論
      新聞瀏覽排行