Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi there,

I am trying to use unions in Dave but run in syntax problems. Here is the sample code

typedef union
{uint16_t a;
uint32_t b;
} Mem;
int main(void)
{
Mem->a=5; <--- ../Main.c:96:4: error: expected identifier or '(' before '->' token
}

the declaration seems to be ok, however I can not access the variable. Does anybody know, what I need to do?

thanks in advance,
Felix
0 Likes
1 Reply
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
smktec wrote:
Hi there,

I am trying to use unions in Dave but run in syntax problems. Here is the sample code

typedef union
{uint16_t a;
uint32_t b;
} Mem;
int main(void)
{
Mem->a=5; <--- ../Main.c:96:4: error: expected identifier or '(' before '->' token
}

the declaration seems to be ok, however I can not access the variable. Does anybody know, what I need to do?

thanks in advance,
Felix


Hi,

This is a C programming topic. You can find your answer else where.

BR
Travis
0 Likes