我是靠谱客的博主 结实书本,这篇文章主要介绍C语言数据类型占用字节大小测试,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
printf("int size = %dn",sizeof(int)); printf("unsigned int size = %dn",sizeof(unsigned int)); printf("short int size = %dn",sizeof(short int)); printf("long size = %dn",sizeof(long)); printf("long int size = %dn",sizeof(long int)); printf("long long int size = %dn",sizeof(long long int)); printf("char size = %dn",sizeof(char)); printf("unsigned char size = %dn",sizeof(unsigned char)); printf("double size = %dn",sizeof(double)); printf("float size = %dn",sizeof(float));
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
/*输出 int size = 4 unsigned int size = 4 short int size = 2 long size = 4 long int size = 4 long long int size = 8 char size = 1 unsigned char size = 1 double size = 8 float size = 4 */

最后

以上就是结实书本最近收集整理的关于C语言数据类型占用字节大小测试的全部内容,更多相关C语言数据类型占用字节大小测试内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(72)

评论列表共有 0 条评论

立即
投稿
返回
顶部