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, s2;

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

  s.c = 1;
  s.s = 2;
  s.i = 3;

  printc(s.c);
  prints(s.s);
  printi(s.i);

  s2.c = 10;
  s2.s = 20;
  s2.i = 30;

  printc(s2.c);
  prints(s2.s);
  printi(s2.i);

  s2 = s;

  printc(s2.c);
  prints(s2.s);
  printi(s2.i);

  return 0;
}
