嵌入式offsetof的使用
时间:12-01
来源:互联网
点击:
#include
typedef struct
{
unsigned int array[2];
unsigned int a;
unsigned char b;
unsigned int c;
unsigned int d;
float f;
}foo;
void main(void)
{
int addr=0;
addr = offsetof(foo,c);
P1 =addr;
addr = offsetof(foo,f);
P1 =addr;
addr = offsetof(foo,a);
P1 =addr;
addr = offsetof(foo,d);
P1 =addr;
addr = offsetof(foo,b);
P1 =addr;
while(1);
}
offseto 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)