/* 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
C语言基本数据类型
最新推荐文章于 2023-11-11 13:50:05 发布