I want to return something from messagearrived and receive that value in main function. How can I achieve this?
1 2 3 4 5 6 7 8 9 10 11 12 13 14
typedefint(*messagehandler)(int);
int subscribe(messagehandler mh)
{
//do something
return 1;
}
int messagearrived(int a)
{
//do something
}
void main()
{
int a = subscribe(messagearrived);
}