C语言基本数据类型

/* WORD一般是无符号类型 */
typedef unsigned short      WORD16;
typedef signed short        SWORD16;

typedef unsigned int        WORD32;
typedef signed int          SWORD32;

typedef unsigned long long  WORD64;
typedef long long           SWORD64;

typedef unsigned long int   WORDPTR;   /* 与指针大小相同的WORD类型, 32位或者64位 */
typedef signed   long int   SWORDPTR;  /* 与指针大小相同的WORD类型, 32位或者64位 */

/* BYTE与WORD,DWORD本质上都是一种无符号整型 */
typedef unsigned char       BYTE; 	/* 1字节 = 8位 */
typedef unsigned short      WORD;	/* 1字 = 2字节 = 16位 */
typedef unsigned int        DWORD;	/* 双字 = 4字节 = 32位 */
typedef unsigned long       DWORD;	/* 双字 = 4字节 = 32位 */

/* 布尔类型,无符号,1字节 */
typedef unsigned char       BOOLEAN;

Tips:

	32位OS:int = long = 4 Bytes
	64位OS:int = 4 Bytes; long = 8 Bytes

	/* long long是C++的正式标准,这也就意味着,该类型不会因为编译器或者开发平台的不同而有所差异,放之四海而皆准; */
	
	char		1 Byte

	short 		2 Bytes (short int, 短整型)

	int 		2/4 Bytes 

	long 		4/8 Bytes (long int, 长整型)

	long long 	8 Bytes (long long int, 双长整型)

	float 		4 Bytes

	double 		8 Bytes

	long double 8/16 Bytes
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值