#include <iostream>
using namespace std;
int main()
{char c;
short s;
long l;
float f;
double d;
long duoble ld;
int array[20];
int *ptr=array;
cout<<sizeof c<<" "<<sizeof s<<" "<<sizeof l<<" "<<sizeof f<<" "<<sizeof d<<" "<<sizeof ld<<" "<<sizeof array<<" "<<sizeof ptr<<endl;
return 0;
}
结果:
1 2 4 4 4 8 8 80 4