c/c++基本类型sizeof:short,unsigned short,int,unsigned int,long,unsigned long,long long,unsigned long lon
- 类型字节表
X86 |
X86_64 |
||||
short |
signed short |
short int |
signed short int |
2 |
2 |
unsigned short |
unsigned short int |
2 |
2 |
||
int |
signed |
signed int |
4 |
4 |
|
unsigned int |
unsigned |
4 |
4 |
||
long |
signed long |
long int |
signed long int |
4 |
8 |
unsigned long |
unsigned long int |
4 |
8 |
||
long long |
signed long long |
long long int |
signed long long int |
8 |
8 |
unsigned long long |
unsigned long long int |
8 |
8 |
- 注意:
x86&x86_64 |
有char总为1字节 |
x86&x86_64 |
有short总为2字节 |
x86 |
有long long就是8字节 |
x86_64 |
有long就是8字节 |
- 例子
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
cout << "sizeof short:" << sizeof(short) << endl;
cout << "sizeof unsigned short:" << sizeof(unsigned short) << endl;
cout << "sizeof int:" << sizeof(int) << endl;
cout << "sizeof unsigned int:" << sizeof(unsigned int) << endl;
cout << "sizeof long:" << sizeof(long) << endl;
cout << "sizeof unsigned long:" << sizeof(unsigned long) << endl;
cout << "sizeof long long:" << sizeof(long long) << endl;
cout << "sizeof unsigned long long:" << sizeof(unsigned long long) << endl;
return 0;
}
c/c++基本类型sizeof:short,unsigned short,int,unsigned int,long,unsigned long,long long,unsigned long lon相关推荐
- 基本功short与Unsigned short以及Java基本类型
C和C++中: short两个字节长度,其中符号位占了一位.所以实际数值位数是15位.取值范围为:-32768~+32768. unsigned short没有符号位,所以实质数值位数是16位.取值范 ...
- short与Unsigned short以及Java基本类型
C和C++中: short两个字节长度,其中符号位占了一位.所以实际数值位数是15位.取值范围为:-32768~+32768. unsigned short没有符号位,所以实质数值位数是16位.取 ...
- unsigned short占几个字节_ARM中,字、半字、字节分别是多少位?
昨晚正准备睡觉,突然想起上学期和PLC老师在课堂争论字.半字.字节在编译器中所占的字节大小的问题.后来查了查,是体系结构不同的原因导致了分歧.今天把ARM结构.8位控制器.16位控制器.以及VC中的标 ...
- unsigned short 与 unsigned long
1. unsigned short (无符号短整型) unsigned short [ int ] 的字节数位2,取值范围是 0 ~ 2^16-1,即 0 ~ 65535 在存储单元中的存储方式 ...
- c语言unsigned char转换成unsigned short,有关c语言数据类型转换之char,unsigned char,unsigned short...
这是一道朗讯的笔试题(我把一些相关资料汇总了一下,希望大家能进来广泛的探讨,不甚感激!) #include int main() { char ca; unsigned char ucb; unsi ...
- static unsigned short,int ,char
static unsigned short,int ,char表示静态变量,在面试时会经常考到,静态变量只会存在一个内存空间,不管什么时候对其改变都会影响下一次执行的结果.而且其值可以被不断的改变,但 ...
- 用apktool反编译,修改添加smali文, 再打包apk遇到的64k问题的解决方法 Unsigned short value out of range: 65536
我把apk文件用apktool反编译后得到smali, smali_classes2, smali_classes3, smali_classes4.......... 然后手工修改包里的smali文 ...
- 游戏接入SDK系列之org.jf.util.ExceptionWithContext: Unsigned short value out of range
问题: 游戏母包,在通过XXSDK进行打包部分渠道(比如OPPO,VIVO)的时候,在回编译的时候,抛出上面的错误. 原因: dex文件中最大的函数个数为65536(unsigned short),如 ...
- stm32 无符号整形_STM32中“unsigned short”和“unsigned int”的区别是什么?
展开全部 unsigned long int在C语言中是无符号长整形变量,是整形变量的一e69da5e887aa62616964757a686964616f31333365646331种. unsig ...
最新文章
- 使用Windbg找出死锁,解决生产环境中运行的软件不响应请求的问题
- Windows 10企业批量部署实战之WDS安装
- 树状数组求区间和模板 区间可修改 参考题目:牛客小白月赛 I 区间
- 华南农业大学c语言期末试题,华南农业大学珠学院C语言期末试卷.doc
- requireJS和seajs区别?
- JavaScript逻辑运算符的使用技巧
- python快递代取系统_代取快递的变现方式,校园跑腿的经营范围有多大?
- 阿里云数字政府市场份额第一,同比增速102.57%
- python中bar的用法_python使用matplotlib绘图 -- barChart
- dedecms联动筛选_DEDECMS分类信息按联动类别筛选的实现方法
- 1042 mysql57_一次处理DB2宕机的实战经历(SQL1042C )
- 案例-旋转木马(CSS3)
- 小高考计算机知识点,小高考政治知识点总结.pdf
- Hibernate组件作为Map索引(四)
- 毕业设计-springboot+vue公租房租赁管理系统
- matlab插值函数
- 彩虹易支付最新版开源版源码分享
- 免费下载C++Prime!
- 计算机伦理学理论分析三大思想,试论伦理学的三种理论形态——基于理论形态学的考察...
- OSChina 周二乱弹 —— 她根本就配不上我这么聪明的男人
热门文章
- 王思聪熊猫互娱破产拍卖3100万
- flask API接口
- Teracloud其他玩法(GoodSync,RaiDrive)
- 高能来袭,CG世纪交易所合约交易公测正式启动
- linux 显示用法,linux screen 用法总结
- DOM 操作成本到底高在哪儿?
- 学习unity从一个小白到一名游戏开发高手
- [渝粤教育] 中国地质大学 电力拖动自动控制系统 复习题 (2)
- 计算机中四舍五入函数,Excel中如何对数据进行“四舍五入”的处理
- Cortex‐M3的Faults异常究竟是什么?