在 MPLAB IDE 中,数据类型的大小是多少(int
、unsigned int
、float
、unsigned float
, char
...)?
最佳答案
如果不知道要为哪个 CPU 编译代码,这很难。假设例如Microchip 的 PIC18 C18 编译器,User Guide声明以下基本类型大小:
TYPE SIZE RANGE
char(1,2) 8 bits -128 127
signed char 8 bits -128 127
unsigned char 8 bits 0 255
int 16 bits -32,768 32,767
unsigned int 16 bits 0 65,535
short 16 bits -32,768 32,767
unsigned short 16 bits 0 65,535
short long 24 bits -8,388,608 8,388,607
unsigned short long 24 bits 0 16,777,215
long 32 bits -2,147,483,648 2,147,483,647
unsigned long 32 bits 0 4,294,967,295
请注意,这包括一些在 C 中不是标准的类型(short long
)。
关于c - MPLAB IDE 数据类型大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1706933/