//#include <apue.h>
#include <iostream>
using namespace std;
int main()
{
char cA;
unsigned char unsigncA;
short int shortA;
unsigned short int unsignShortIntA;
int iA;
unsigned int unsignA;
long lA;
long int lintA;
float fA;
double dA;
long double ldA;
cout
<<"\n char"<<sizeof(cA)
<<"\n unsigned char"<<sizeof(unsigncA)
<<"\n short int "<<sizeof(shortA)
<<"\n unsigned short int "<<sizeof(unsignShortIntA)
<<"\n int "<<sizeof(iA)
<<"\n unsigned int "<<sizeof(unsignA)
<<"\n long "<<sizeof(lA)
<<"\n long int"<<sizeof(lintA)
<<"\n float "<<sizeof(fA)
<<"\n double "<<sizeof(dA)
<<"\n long double "<<sizeof(ldA);
}
常见的一种运行结果
char1
unsigned char1
short int 2
unsigned short int 2
int 4
unsigned int 4
long 8
long int8
float 4
double 8
long double 16