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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -