本文主要是介绍BC3 有容乃大,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
描述
确定不同整型数据类型在内存中占多大(字节),输出不同整型数据类型在内存中占多大(字节)。
输入描述:
无
输出描述:
不同整型数据类型在内存中占多大(字节),具体格式详见输出样例,输出样例中的?为不同整型数据类型在内存中占的字节数。输出样例如下:
The size of short is ? bytes.
The size of int is ? bytes.
The size of long is ? bytes.
The size of long long is ? bytes.
#include <stdio.h>
int main()
{printf("The size of short is %d bytes.\n",sizeof(short));printf("The size of int is %d bytes.\n",sizeof(int));printf("The size of long is %d bytes.\n",sizeof(long));printf("The size of long long is %d bytes.\n",sizeof(long long));}
这篇关于BC3 有容乃大的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!