Problems with Extern Array of Pointers
Posted: Tue Sep 07, 2010 12:59 am
Hello,
it seems that there are some problems with array of pointers with external memory variables. There are no problems with the same array of pointers with internal memory/variables. The following snippet gives an example:
Cheers,
danny
it seems that there are some problems with array of pointers with external memory variables. There are no problems with the same array of pointers with internal memory/variables. The following snippet gives an example:
- Code: Select all
struct PointerArray {
BYTE* ptrByte [4];
}
PointerArray InternMem;
extern PointerArray ExternMem = { "", 0x400000 };
BYTE Octet=123;
InternMem.ptrByte[1]=&Octet;
PrintF ("Intern: %d (equals to 123)", *InternMem.ptrByte [1]);
Octet=*ExternMem.ptrByte[1]; //should read byte at [0x00400004], but gives error "Code emition failed!"
PrintF ("Extern: %d", Octet);
Cheers,
danny