Not applicable
Jan 30, 2016
02:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 30, 2016
02:55 AM
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
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
- Tags:
- IFX
1 Reply
Jan 31, 2016
06:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 31, 2016
06:25 PM
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