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

来源:互联网 发布:ios511旧版软件下载 编辑:程序博客网 时间:2024/05/18 03:28
C++与Java基本数据类型及所占用内存空间比较
----------------C++------------------------Java----------
01)bool----------------1 byte---------01)boolean--1 byte
02)char----------------1 byte---------02)char-----2 bytes
---signed char---------1 byte---------03)byte-----1 byte
---unsigned char-------1 byte
03)wchar_t-------------2 bytes
04)short---------------2 bytes--------04)short----2 bytes
---unsigned short------2 bytes
05)int-----------------4 bytes---------05)int------4 bytes
---unsigned int--------4 bytes
06)long----------------4 bytes--------06)long-----8 bytes
---unsigned long-------4 bytes
07)long long-----------8 bytes
---unsigned long long--8 bytes
08)float---------------4 bytes---------07)float----4 bytes
09)double--------------8 bytes--------08)double---8 bytes
10)long double--------12 bytes
原创粉丝点击