Hello, I have problems when I trying to create a pointer to a struct initialized at a specific address. I tied a lot of different combinations, but still I does not get it to work. Here is one example:
Code:
#include <stdio.h>
#define INIT_ADR ((pointerFOO) 0x00000000);
typedef struct FOO_tag{
int PER;
int PDR;
int PSR;
} FOO, *pointerFOO;
int main(void)
{
pointerFOO pFOO = INIT_ADR;
printf("&(pFOO->PER)= %i\n",&(pFOO->PER));
printf("&(pFOO->PDR)= %i\n",&(pFOO->PDR));
pFOO->PER = 1;
return(0);
}
I get some error with pFOO->PER = 1 when I am trying to run the code. Is there some who knows how I can solve this problem?
/Dan