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:会笑的人,运气通常都会比别人好。
  • 相关阅读:
    建立文件类型关联
    Delphi程序员,你们现在还好吗?
    加一文档到开始菜单中的文件夹下
    文本转换为GIF
    取消文件类型的关联
    取得任务栏的高度
    TeeChart使用范例
    同步SQL Server服务器时间
    注册系统热键
    山西襄汾溃坝事故已造成259人死亡
  • 原文地址:https://www.cnblogs.com/thinkinc999/p/13706513.html
Copyright © 2011-2022 走看看