1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <stdio.h> struct value { int tag; union { int i; double r; char * sl; } u; }; void print_value(struct value * s) { printf ("%d\n", s->u.i); }