我是靠谱客的博主 苗条蜜蜂,这篇文章主要介绍C/C++中数据类型在不同平台下所占字节数,现在分享给大家,希望可以做个参考。

标准的32位的系统:
char 1个字节
short 2个字节
int 4个字节
long: 4个字节
float: 4个字节
double: 8个字节
long long: 8个字节

16位,32位,64位平台固定的
float:4个字节
double: 8个字节

跨平台运用
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;

最后

以上就是苗条蜜蜂最近收集整理的关于C/C++中数据类型在不同平台下所占字节数的全部内容,更多相关C/C++中数据类型在不同平台下所占字节数内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(101)

评论列表共有 0 条评论

立即
投稿
返回
顶部