#include <stdio.h>
 
struct structA_t{
  char* a_one;
  char* a_two;
};
 
struct structB_t{
  char* b_one;
  char* b_two;
  char* b_three;
};
 
struct structC_t{
  char* c_one;
  char* c_two;
  char* c_three;
};
 
typedef enum my_e_dataId{
  dataid_invalid = 0,
  dataid_a,
  dataid_b,
  dataid_c
} my_dataId;
 
typedef union u_data {
  struct structA_t* a;
  struct structB_t* b;
  struct structC_t* c;
}mydata;
 
typedef struct s_some_type{
  my_dataId dataId;
  mydata myData;
}some_type;
 
static struct structA_t a = {"ads", "as"};
static struct structB_t b = {"zzds", "dfr", "shywsd"};
static struct structC_t c = {"ssa", "ad", "dhksdhs"};
 
int main (int argc, char** argv){
  some_type sta[] = {
    {dataid_a, (struct structA_t*) &a},
    {dataid_b, (struct structA_t*) &b},
    {dataid_c, (struct structA_t*) &c}
  };
 
  printf("second field of a: %s\n", sta[0].myData.a->a_two);
  printf("third field of c: %s\n", sta[2].myData.c->c_three);
 
  return 0;
}