首頁  >  文章  >  double佔幾個位元組

double佔幾個位元組

coldplay.xixi
coldplay.xixi原創
2020-12-25 10:36:47104884瀏覽

double佔的位元組:1、16位元編譯器下,double佔8個位元組;2、32位元編譯器下,double佔8個位元組;3、64位元編譯器下, double佔8個位元組。

double佔幾個位元組

本文操作環境:windows10系統、thinkpad t480電腦。

double佔的位元組:

1、16位元編譯器

  • char : 1個位元組

  • char*(即指標變數): 2個位元組

  • ##short int : 2個位元組

  • int:  2個位元組

  • unsigned int : 2個位元組

  • float:  4個位元組

  • double:   8個位元組

  • long:   4個位元組

  • long long:  8個位元組

  • unsigned long:  4個位元組

#2、32位元編譯器

  • char :1個位元組

  • #char*(即指標變數): 4個位元組(32位元的尋址空間是2^32, 即32個bit,也就是4個位元組。同理64位元編譯器)

  • short int : 2個位元組

  • int:  4個位元組

  • unsigned int : 4個位元組

  • float:  4位元組

  • double:   8個位元組

  • long:   4個位元組

  • long long:  8個位元組

  • unsigned long:  4個位元組

3、 64位元編譯器

  • char :1個位元組

  • char*(即指標變數): 8個位元組

  • short int : 2個位元組

  • int:  4個位元組

  • unsigned int : 4個位元組

  • float:  4個位元組

  • double:   8個位元組

  • long:   8個位元組

  • long long:  8個位元組

  • unsigned long:  8個位元組 

想了解更多程式設計學習,請關注

php培訓欄位!

#

以上是double佔幾個位元組的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn