Fundamental data types

本文介绍了计算机编程中常用的数据类型,包括字符、整数、浮点数等的基本属性和范围。详细解释了每种数据类型的存储大小及取值范围,并对比了不同精度浮点数的特点。

Name

Description

Size*

Range*

char

Character or small integer.

1byte

signed: -128 to 127
unsigned: 0 to 255

short int (short)

Short Integer.

2bytes

signed: -32768 to 32767
unsigned: 0 to 65535

int

Integer.

4bytes

signed: -2147483648 to 2147483647
unsigned: 0 to 4294967295

long int (long)

Long integer.

4bytes

signed: -2147483648 to 2147483647
unsigned: 0 to 4294967295

bool

Boolean value. It can take one of two values: true or false.

1byte

true or false

float

Floating point number.

4bytes

3.4e +/- 38 (7 digits)

double

Double precision floating point number.

8bytes

1.7e +/- 308 (15 digits)

long double

Long double precision floating point number.

8bytes

1.7e +/- 308 (15 digits)

wchar_t

Wide character.

2bytes

1 wide character

The values of the columns Size and Range depend on the architecture of the system where the program is compiled and executed.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值