C++
char 1
short int 2
int 4
long int 8
float 4
double 8
long double 8
下面是计算程序:
#include<math.h>//不确定是否使用到
#include<iostream.h>
#include<conio.h>//输入流getch()
int main(){
char ch;
int i;
double d;
float f;
long double ld;
cout<<ch<<" "<<i<<" "<<d<<" "<<endl;
cout<<f<<" "<<ld<<endl;
getch();
return 0;
}
//----------------------------
java
byte 1
char 4
int 4
float 4
double 8
下面是计算程序:
int a=0;
float f=0.0f;
double d=0.0;
System.out.println(Integer.valueOf(a).SIZE+" "+Float.valueOf(f).SIZE+" "+Double.valueOf(d).SIZE);
这里输出32 32 64.