close

由於常常要計算空間大小,又在各種開發軟體間流竄,為方便查證,還是留下紀錄.

unsigned char a,b,c,d,e,f,g,h,i;

int main()

{
   a=sizeof(char);         //1 bytes

   b=sizeof(short int);   //2 bytes

   c=sizeof(int);            //4 bytes

   d=sizeof(long);         //4 bytes

   e=sizeof(long int);    //4 bytes

   f=sizeof(float);         //4 bytes

   g=sizeof(double);    //8 bytes
    
   h=sizeof(unsigned int); //4 bytes
    
   i=sizeof(unsigned long); //4 bytes


   while(1);

}

arrow
arrow
    全站熱搜

    linear 發表在 痞客邦 留言(0) 人氣()