码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2016-12-08 21:30:00      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:include   sys   system   数据   short   div   log   网易   c程序   

 

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整型基础

标签:include   sys   system   数据   short   div   log   网易   c程序   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!