32位和64位系统,C语言中char,short,int,long,char*,int*,int**各占多少字节

如题所述

1、在32位系统中:

char(1)字节

short(2)字节

int(2)字节

long(4)字节

char*(4)字节

int*(4)字节

int**(4)字节

2、在64位系统中:

char(1)字节

short(2)字节

int(4)字节

long(8)字节

char*(4)字节

int*(4)字节

int**(4)字节

扩展资料

在C++中short占2字节,int、float、long都占4字节,double占8字节。

指针长度和地址总线有关。因为指针记录的就是一个地址,那么32位的就是4字节,64位的就是8字节。

char占1字节,short占2字节,int、float、long都占4字节,double占8字节,任意类型的指针都占4个字节。

温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-09-09
TC中char(1),short(2),int(2),long(4),char*(4),int*(4),int**(4)
VC中char(1),short(2),int(4),long(8),char*(4),int*(4),int**(4)
跟操作系统没有关系,跟使用的编译器有关本回答被网友采纳
第2个回答  2014-10-26
这个和编译器有关。不同的编译器不一样。追问

我只想知道确切的答案