zoukankan      html  css  js  c++  java
  • 32/64位下面的基本数据类型的大小

      1 // Test64.cpp : This file contains the 'main' function. Program execution begins and ends there.
      2 //
      3 
      4 #include <iostream>
      5 
      6 int main()
      7 {
      8     printf("char size = %d
    ", sizeof(char));
      9     printf("unsigned char size = %d
    ", sizeof(unsigned char));
     10     printf("short size = %d
    ", sizeof(short));
     11     printf("unsigned short size = %d
    ", sizeof(unsigned short));
     12     printf("int size = %d
    ", sizeof(int));
     13     printf("unsigned int size = %d
    ", sizeof(unsigned int));
     14     printf("long size = %d
    ", sizeof(long));
     15     printf("unsigned long size = %d
    ", sizeof(unsigned long));
     16     printf("long long size = %d
    ", sizeof(long long));
     17     printf("float size = %d
    ", sizeof(float));
     18     printf("long float size = %d
    ", sizeof(long float));
     19     printf("double size = %d
    ", sizeof(double));
     20     printf("long double size = %d
    ", sizeof(long double));
     21 
     22 
     23     printf("char* size = %d
    ", sizeof(char*));
     24     printf("short* size = %d
    ", sizeof(short*));
     25     printf("int* size = %d
    ", sizeof(int*));
     26     printf("long* size = %d
    ", sizeof(long*));
     27     printf("float* size = %d
    ", sizeof(float*));
     28     printf("double* size = %d
    ", sizeof(double*));
     29 
     30 }
     31 

    32位下的:

    image


    64位下的:

    image

    PS:会笑的人,运气通常都会比别人好。
  • 相关阅读:
    UVa 1605
    UVa 120
    UVa 10384
    UVa 11694
    UVa 11846
    常用小函数
    【DP】:CF #319 (Div. 2) B. Modulo Sum
    类的无参方法
    类和对象
    七言
  • 原文地址:https://www.cnblogs.com/thinkinc999/p/13706513.html
Copyright © 2011-2022 走看看