数据类型及其空间大小,vs2012实测
2024-10-16 02:18:50
#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\n", sizeof(double));
printf("size float = %d\n", sizeof(float)); printf("size long = %d\n", sizeof(long));
printf("size long int = %d\n", sizeof(long int));
printf("size int = %d\n", sizeof(int));
printf("size short int = %d\n", sizeof(short int));
printf("size short = %d\n", sizeof(short));
printf("size char = %d\n", sizeof(char));
printf("size char* = %d\n", sizeof(char *)); printf("size S_DATA = %d\n", 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 . . .
*/
最新文章
- MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的真正原因
- Clustering Methods: Benefits and Limitations
- JMeter学习(三十五)使用jmeter来发送json/gzip格式数据
- eclipse技巧,快捷键
- Codeforces Round #164 (Div. 2)
- poj2137 dp
- C#虚方法认识
- [HZAU]华中农业大学第四届程序设计大赛网络同步赛
- Windows-to-go-带着win10满街跑
- CURL 多线程问题
- [python] 字符串与列表、字典的转换
- CAGradientLayer的一些属性解析-b
- android:contentDescription的作用是什么
- 实时监听文本框输入 oninput、onchange与onpropertychange事件的用法和区别
- 一个自己研究出来的字符串匹配算法-k子串算法
- Java基础知识学习思维导图
- Elasticsearch中使用groovy脚本处理boolean字段的一个问题
- 013 JstlView
- PreparedStatement与Statement区别
- vs2017连接mysql以及问题汇总