K33rg4t3
Full Member level 3
Hey
I have a strange issue.
Take a look:
Why am I having such strange issues with struct member access? I don't know what's wrong...
BTW: sizeof(TEST) = 4 ...
I have a strange issue.
Take a look:
Code:
typedef struct
{
char data[4];
} TEST;
void doTest(char *data)
{
char txt[64];
TEST *p;
UART1_Write(data); // writes ABC
p = (TEST*)data;
sprintf(txt,"%c %c",p->data[0], p->data[1]);
UART1_Write(txt); // writes A C !!
}
Why am I having such strange issues with struct member access? I don't know what's wrong...
BTW: sizeof(TEST) = 4 ...