void printc(char val);
void prints(short val);
void printi(int val);

union sample {
  char c;
  short s;
  int i;
};

int main()
{
  union sample s, *p;

  printi(sizeof(union sample));
  printi(sizeof(s));
  printi(sizeof(*p));

  p = &s;

  s.c = 1;
  printc(p->c);

  s.s = 2;
  prints(p->s);

  s.i = 3;
  printi(p->i);

  p->c = 11;
  printc(p->c);

  p->s = 12;
  prints(p->s);

  p->i = 13;
  printi(p->i);

  return 0;
}
