The moose likes C / C++ and the fly likes using typedef in union Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » C / C++
Bookmark "using typedef in union" Watch "using typedef in union" New topic

using typedef in union

Anand Damodaran

Joined: Oct 04, 2012
Posts: 21
Hi Friends,
I can't able to declare typedef in the union,say,

union xyz{
typedef struct bio{
char name[100];
int age;
float salary;
char a[sizeof(struct bio)];


it works well if i remove typedef keyword.

why is it so?

with respect
I agree. Here's the link:
subject: using typedef in union
It's not a secret anymore!