现在的位置: 首页 > 综合 > 正文

C++与Java基本数据类型比较

2014年01月24日 ⁄ 综合 ⁄ 共 929字 ⁄ 字号 评论关闭
 

C++与Java基本数据类型及所占用内存空间比较

----------------C++
-----------                              ------------Java
----------

(01)bool------------------1 byte                         01)boolean--1 byte

(02)char------------------1 byte                         
02)char------2 bytes

(03)signed char---------1 byte                         03)byte------1 byte

(04)unsigned char------1 byte

(05)wchar_t--------------2 bytes

(06)short-----------------2 bytes                        04)short-----2 bytes

(07)unsigned short-----2 bytes

(08)int--------------------4 bytes                        05)int---------4 bytes

(09)unsigned int--------4 bytes

(10)long------------------4 bytes
                       06)long-------8 bytes

(11)unsigned long-------4 bytes

(12)long long-------------8 bytes

(13)unsigned long long--8 bytes

(14)float-------------------4 bytes                      07)float-------4 bytes

(15)double----------------8 bytes                      08)double----8 bytes

(16)long double---------12 bytes

抱歉!评论已关闭.