c++ 标准数据类型
来源:互联网 发布:淘宝进口零食店知乎 编辑:程序博客网 时间:2024/06/03 22:06
int 类型与操作系统,编译器相关
如:win32下为32位,win64下为64位
如果软件有移植需求,请使用固定大小的数据类型
注意:long 的字节数是不随平台改变的,都是4字节
补充:
BYTE 1字节typedef unsigned char BYTE;
WORD 2字节typedef unsigned short WORD;
DWORD 4字节typedef unsigned long DWORD;
数据类型名称
字节数
别名
取值范围
int
*
signed,signed int
由操作系统决定,即与操作系统的"字长"有关
unsigned int
*
unsigned
由操作系统决定,即与操作系统的"字长"有关
__int8
1
char,signed char
–128 到 127
__int16
2
short,short int,signed short int
–32,768 到 32,767 【5位 3万】
__int32
4
signed,signed int
–2,147,483,648 到 2,147,483,647 【10位 21亿】
__int64
8
无
–9,223,372,036,854,775,808 到 9,223,372,036,854,775,807 【19位 *亿】
bool
1
无
false 或 true
char
1
signed char
–128 到 127
unsigned char
1
无
0 到 255
short
2
short int,signed short int
–32,768 到 32,767
unsigned short
2
unsigned short int
0 到 65,535
long
4
long int,signed long int
–2,147,483,648 到 2,147,483,647
long long
8
none (but equivalent to __int64)
–9,223,372,036,854,775,808 到 9,223,372,036,854,775,807
unsigned long
4
unsigned long int
0 到 4,294,967,295 【10位 42亿】
enum
*
无
由操作系统决定,即与操作系统的"字长"有关
float
4
无
3.4E +/- 38 (7 digits)
double
8
无
1.7E +/- 308 (15 digits)
long double
8
无
1.7E +/- 308 (15 digits)
wchar_t
2
__wchar_t
0 到 65,535
- 标准C或C++没有的数据类型
- 标准C或C++没有的数据类型
- 从IEEE754标准谈C语言浮点数据类型
- C标准库定义的UNIX系统的基本数据类型
- C语言的标准和一些基本的数据类型
- SQL标准数据类型
- SQL标准数据类型
- c++ 标准数据类型
- 数据类型 与 标准IO
- 标准数据类型上下限
- ANSI标准数据类型
- 抽象数据类型标准库
- SQL标准数据类型
- SQL标准数据类型
- c++ 标准数据类型
- 标准数据类型特性总结
- c++ 标准数据类型
- python标准数据类型
- dexdump命令使用
- 移植完linux-3.4.2内核,启动系统后使用命令ifconfig -a查看网络配置只有一个local backloop
- 浅谈嵌入式
- java深拷贝和浅拷贝
- 提高项目25.3选择排序
- c++ 标准数据类型
- BOMC工具使用简介
- db2的常见操作
- 1027. Colors in Mars (20)
- ZooKeeper客户端地址列表的随机原理
- ImageButton点击按钮改变图片
- IPv6 Neighbor Discovery (ND) and Multicast Listener Discovery (MLD) Challenges
- Android文件监控FileObserver介绍
- 关于微信分享朋友圈、分享给朋友、隐藏“传播类”和“保护类”按钮