c - expected ‘uint32_t’ but argument is of type ‘uint32_t *’ -
i new in c, trying call function, gives me error can not understand why
int set_price(&colour->type.name);
it returns me expected ‘uint32_t’ argument of type ‘uint32_t *’. warning: passing argument ‘int set_price’ makes integer pointer without cast
where pointer
house_list *colour = null;
and name defined in struct as
uint32_t name;
the original function accept
int set_price(uint32_t name)
{
/do here/
}
what do wrong? if in struct member, name defined uint32_t, , defined pointer colour, believe need use & before colour->type , use dot before name isn't it?
thank you
set_price(&colour->type.name);
remove & , you'll fine
set_price(colour->type.name);
set_price
expects integer argument, not pointer integer.
i suggest should read a c book.
Comments
Post a Comment