AnsweredAssumed Answered

function pointer problem

Question asked by harmon.heather on Jun 26, 2015
Latest reply on Jun 26, 2015 by Clive One
hi

Im using keil developing on a stm32f4 discovery board.

im trying to make a function pointer to be used by other modules.

something like:

extern void (*p)() ;

void myfunc()
{
    printf("function pointer");
}

somefunction(struct Adc *instance)
{
    p = myfunc();
}

i get the following error at the "p = myfunc();"-line:
error:  #513: a value of type "void" cannot be assigned to an entity of type "void (*)(void)"

know  this  is prob a noob question  - but ive tried finding a solution - but cannot seem to solve it.

can any1 tell me waht im doing wrong?

thanks in advance

Outcomes