File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
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
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: using typedef in union