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:会笑的人,运气通常都会比别人好。
  • 相关阅读:
    正则表达式
    什么是面向对象
    关于jdk,jre,jvm和eclipse的一些总结
    分析ajax爬取今日头条街拍美图
    pycharm误删恢复方法及python扩展包下载地址
    django 之 视图层、模板层
    django
    django框架基础二
    jdango框架基础一
    安装软件,提高速度,可以使用清华源
  • 原文地址:https://www.cnblogs.com/thinkinc999/p/13706513.html
Copyright © 2011-2022 走看看