当前位置:网站首页>32位机器和64位机器基本数据类型长度
32位机器和64位机器基本数据类型长度
2022-08-09 13:05:00 【zhouyongku】
测试对象:ubuntu64
Ubuntu64位:
类型 字节数
char 1
short int 2
int 4
float 4
double 8
long 8
long long 8
void * 8
Windows64位:
类型 字节数
char 1
short int 2
int 4
float 4
double 8
long 8
long long 8
void * 8
Windows32位:
类型 字节数
char 1
short int 2
int 4
float 4
double 8
long 4
long long 8
void * 4
测试用例:
#include<stdlib.h>
using namespace std;
int main( int argc,char ** argv )
{
void *a=malloc(2);
float b;
char c;
int d;
double e;
short int f;
long g;
long long k;
printf("size:pointer=%d,float=%d,char=%d,int=%d,double=%d,short int=%d,long=%d,long long =%d\n",
sizeof(a),sizeof(b),sizeof(c),sizeof(d),sizeof(e),sizeof(f),sizeof(g),sizeof(k));
return 0;
}
边栏推荐
- R语言kaggle 游戏数据探索与可视化
- The sword refers to Offer 57 - II. and is a continuous positive sequence of s (sliding window)
- 现在40系显卡都快出来了,为何1060型号的显卡还有这么多人用?
- CPU-MIPS32 instruction architecture (unlocked pipeline microprocessor)
- IDEA Gradle 常遇问题(二)(持续更新)
- Deep Learning Based on R Language - Simple Regression Case
- 陈强教授《机器学习及R应用》课程 第十七章作业
- Professor Chen Qiang's "Machine Learning and R Application" course Chapter 16 Assignment
- Bitmaps and bit operations
- 面试攻略系列(三)-- 高级开发工程师面试问些啥?
猜你喜欢
绘制混合密度函数图以及添加分位数线
GIN Bind模式获取参数和表单验证
Anta and Huawei Sports Health jointly verify the champion running shoes and lead Chinese sports with innovation
快来扔鸡蛋。
基于 R 语言的判别分析介绍与实践 LDA和QDA
Explanation of RTSP protocol
uni-app - uview Swiper 轮播图组件点击跳转链接(点击后拿到 item 行数据, 取出数据做操作)
Unity3d_API_Gyroscope 陀螺仪的接口
Unicom network management protocol block diagram
5G China unicom general exception handling
随机推荐
WSA toolkit installed app store tip doesn't work how to solve?
npm install失败
How to solve the 0x80070005 error when the computer is reinstalled and the system is restored
Professor Chen Qiang's "Machine Learning and R Application" course Chapter 15 Homework
FFmpeg multimedia file processing (implementation of ffmpeg operation directory and list)
5G China unicom AP:B SMS ASCII 转码要求
Rmarkdown教程
绘制混合密度函数图以及添加分位数线
gin的中间件和路由分组
kustomize entry example and basic syntax instructions
[FPGA Tutorial Case 48] Image Case 8 - Realization of Converting RGB Image to HSV Image Based on FPGA, Assisted Verification by MATLAB
Realization of RTSP Protocol
记录本项目中用到的系统调用与C库函数-2
5G China unicom 一般性异常处理
Come and throw eggs.
19、学习MySQL 索引
43. The sword refers to Offer 1 ~ 1 the number of occurrences of n integers (recursive, mathematics)
puzzle(016.5)逻辑电路
[MRCTF2020]套娃-1
Q_04_04 Q#类型模型