int,float,char,long它们在c语言中占的字节数是多少

如题所述

我的电脑int 是4Byte,楼上别误导,

根据各种计算机来定的。
最好的办法就在你的计算机里运行下面的程序来确定:

#include <stdio.h>
#include<conio.h>

main()
{
printf("float = %d,char = %d,int = %d,long = %d",sizeof(float),sizeof(char),sizeof(int),sizeof(long));
getch();
}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2008-07-15
char 8
int 16
long 32
float 32
double 64

这是占的位数 bit
1 Byte=8 bit
除以8就是字节数 byte
第2个回答  2008-07-15
int 2B
float 4B
char 1B
long 4B本回答被网友采纳
第3个回答  2008-07-15
int 2B
float 4B
char 1B
long 4B