对于Keil
一、先定义几个变量,用于存放各数据类型的字节数。
//#include<LPC214x.H>
#include<stdio.h>
unsigned char a,b,c,d,e,f,g;
main()
{
}
三、查看各地址存放的值。View---memory
得出:
char占用1个字节
short int占用2字节
int占用4字节
long占用4字节
long int占用4字节
float占用4字节
double占用8字节
我们即可这样定义宏:
typedef unsigned char
typedef signed
typedef unsigned short
typedef signed
typedef unsigned int
typedef signed
typedef float
typedef double