c - expected identifier or ‘(’ before ‘=’ token -


i'm having trouble line:

ut_slot = malloc(tab_size * sizeof ut_slot_t);

these variables defined in header file:

typedef struct _ut_slot { ... ... } ut_slot_t, *ut_slot;

error written in title, help?

change

ut_slot = malloc(tab_size * sizeof ut_slot_t); 

to

ut_slot_t *ut_slot = malloc(tab_size * sizeof *ut_slot); 

and remove ut_slot typedef:

typedef struct _ut_slot { ... ... } ut_slot_t; 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -