#include<iostream>
using namespace std;
int main( )
{int a;
float b;
double c;
char d;
cout<<"int 型占的字节数"<<sizeof(a)<<endl;
cout<<"float 型占的字节数"<<sizeof(b)<<endl;
cout<<"double 型占的字节数"<<sizeof(c)<<endl;
cout<<"char 型占的字节数"<<sizeof(d)<<endl;
return 0;
}
int 型占的字节数4
float 型占的字节数4
double 型占的字节数8
char 型占的字节数1
Press any key to continue