当前位置:网站首页>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;
}
边栏推荐
- render解析
- 正则表达式-re模块
- FFmpeg multimedia file processing (ffmpeg prints audio and video Meta information)
- 关于做2D游戏时,Canvas边界显示在Game窗口的问题
- 联通网管协议框图
- [FPGA Tutorial Case 48] Image Case 8 - Realization of Converting RGB Image to HSV Image Based on FPGA, Assisted Verification by MATLAB
- The sword refers to Offer 56 - II. Number of occurrences of a number in an array II (bit operation)
- The sword refers to Offer 57 - II. and is a continuous positive sequence of s (sliding window)
- GIN初探,环境安装
- CPU-MIPS32 instruction architecture (unlocked pipeline microprocessor)
猜你喜欢
搭建大型分布式服务(二)搭建会员服务
5G China unicom 直放站 网管协议 实时性要求
行程和用户[阅读理解法]
Come and throw eggs.
gin的中间件和路由分组
Final assignment of R language data analysis in a university
关于做2D游戏时,Canvas边界显示在Game窗口的问题
[MRCTF2020]套娃-1
FFmpeg多媒体文件处理(ffmpeg处理流数据的基本概念)
Anta and Huawei Sports Health jointly verify the champion running shoes and lead Chinese sports with innovation
随机推荐
Process/Thread Related in Sandbox - 2
glibc memory management model freeing C library memory cache
行程和用户[阅读理解法]
驻波比计算方法
NC40 链表相加(二)
用plot_hist_numeric()实现画直方图
GIN file upload and return
FFMPEG multimedia file processing (deletion and renaming of ffmpeg files)
ARM board adds routing function
关于做2D游戏时,Canvas边界显示在Game窗口的问题
Professor Chen Qiang the machine learning and R application course chapter 18 assignments
R 语言 2010.1至2021.12艾滋病每月发病人数 时间序列分析
GIN中GET POST PUT DELETE请求
2.微服务'黑话'集锦及Eureka注册中心相关概念
基于 R 语言的判别分析介绍与实践 LDA和QDA
npm install失败
记录本项目中用到的系统调用与C库函数-2
FFmpeg multimedia file processing (implementation of ffmpeg operation directory and list)
WPF 系统托盘 图标闪烁
Q_04_06 把它放在一起:传送