• 数据类型及其空间大小,vs2012实测


    #include "stdafx.h"
    #include <stdio.h>
    #include "common.h"
    #include "t4.h"
    
    typedef struct {
    	long l;
    	int i[5];
    	char c;
    	double db;
    }S_DATA;
    
    
    int t4(void)
    {
    
    	printf("size double = %d
    ", sizeof(double));
    	printf("size float = %d
    ", sizeof(float));
    
    	printf("size long = %d
    ", sizeof(long));
    	printf("size long int = %d
    ", sizeof(long int));
    	printf("size int = %d
    ", sizeof(int));
    	printf("size short int = %d
    ", sizeof(short int));
    	printf("size short = %d
    ", sizeof(short));
    	printf("size char = %d
    ", sizeof(char));
    	printf("size char* = %d
    ", sizeof(char *));
    
    	printf("size S_DATA = %d
    ", sizeof(S_DATA));
    
    
    	return 0;
    }
    /*
    size double = 8
    size float = 4
    size long = 4
    size long int = 4
    size int = 4
    size short int = 2
    size short = 2
    size char = 1
    size char* = 4
    size S_DATA = 40
    Press any key to continue . . .
    */
    
  • 相关阅读:
    在不给spring管理的类中获取类
    poi操作excel
    闭包
    输入url的过程发生了什么?
    跨域
    函数节流-防抖函数
    预解析-案例
    移动端适配方案
    实现元素水平居中和垂直居中的几种方法
    css小知识点
  • 原文地址:https://www.cnblogs.com/mylinux/p/4629882.html
Copyright © 2020-2023  润新知