struct node {
 struct node *next;
 int type;  // 0=int, 1=double, ...
 union {
  int i;
  double d;
 } data;
};
こんな感じ?