32位系统中类型与所占的字节数的关系,通过如下程序进行测试
#include <iostream>
using namespace std;
int main()
{
cout<<"the 32bit operation system int is "<<sizeof(int)<<endl;
cout<<"the 32bit operation system int* is "<<sizeof(int*)<<endl;
cout<<"the 32bit operation system char is "<<sizeof(char)<<endl;
cout<<"the 32bit operation system char* is "<<sizeof(char*)<<endl;
cout<<"the 32bit operation system float is "<<sizeof(float)<<endl;
cout<<"the 32bit operation system float* is "<<sizeof(float*)<<endl;
cout<<"the 32bit operation system long is "<<sizeof(long)<<endl;
cout<<"the 32bit operation system long* is "<<sizeof(long*)<<endl;
cout<<"the 32bit operation system double is "<<sizeof(double)<<endl;
cout<<"the 32bit operation system double* is "<<sizeof(double*)<<endl;
return 0;
}