首页 > 编程语言 > 详细

网易云课堂_艾叔:零基础一站式C语言|C程序设计精讲_章节5整型_课时35整型基础

时间:2016-12-08 21:28:57      阅读:305      评论:0      收藏:0      [点我收藏+]

 

C的10种数据类型

 

sizeof(char)=1
sizeof(unsigned char)=1
sizeof(short)=2
sizeof(unsigned short)=2
sizeof(int)=4
sizeof(unsigned int)=4
sizeof(long)=4
sizeof(unsigned long)=4
sizeof(long long)=8
sizeof(unsigned long long)=8
请按任意键继续. . .

 

#include <stdio.h>
#include <stdlib.h>

int main()
{
	printf("sizeof(char)=%zd\n", sizeof(char));
	printf("sizeof(unsigned char)=%zd\n", sizeof(unsigned char));

	printf("sizeof(short)=%zd\n", sizeof(short));
	printf("sizeof(unsigned short)=%zd\n", sizeof(unsigned short));

	printf("sizeof(int)=%zd\n", sizeof(int));
	printf("sizeof(unsigned int)=%zd\n", sizeof(unsigned int));

	printf("sizeof(long)=%zd\n", sizeof(long));
	printf("sizeof(unsigned long)=%zd\n", sizeof(unsigned long));

	printf("sizeof(long long)=%zd\n", sizeof(long long));
	printf("sizeof(unsigned long long)=%zd\n", sizeof(unsigned long long));

	system("pause");

	return 0;
}

 

网易云课堂_艾叔:零基础一站式C语言|C程序设计精讲_章节5整型_课时35整型基础

原文:http://www.cnblogs.com/denggelin/p/6146224.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!