In C if I have
typedef struct
{
Token_type type;
Token_data data;
} Token_t;
typedef struct sitem {
char *key;
struct Token_t *token;
} item_t;
Why can't I do?
void insert(char *key, Token_t *data) {
item_t* new_item = malloc(sizeof (_item_t));
new_item->token = data;
}
@matrix
Man, I really hate C's pointer stuff...
One problem might be that you need to do new_item->token = *data