C Struct inside union inside struct

c++structunions

How do i initialize a variable of structure B or C?

typedef struct _A
{
  union
  {
    struct
    {
      int b;
    } B;
    struct
    {
      int c;
    } C;
  } u;
} A;

Something like
A.u.B *bVar; doesn't work

Best Solution

The typedef only covers A, not the union or structures defined therein.

typedef can't be nested like that - each user-defined "type" must have a single label, so a declaration of a variable of type A.u.B is illegal.