Anu Radha

How to handle different functions using function pointers

Discussion created by Anu Radha on Apr 17, 2008
Latest reply on Apr 21, 2008 by bigmac
In my program i need to handle different type of functions.I created some structure for accessing different functions.

typedefstruct{
UCHAR (*const GetFunc)(void
);
}
UCHAR_CPMTS;

typedef struct{
UINT (*const GetFunc)(void
);
}UINT_CPMTS;

typedefstruct{
void
(*constSetFunc)(UCHAR);
}
UCHAR_CPMTS_INIT;

typedef
struct{
void
(*constSetFunc)(UINT);
}UINT_CPMTS_INIT;

using this pointers i can handle only  functions having uchar,uint return types and as arguements.But i need to handle SCHAR, as well as functions with more no of arguements.How to handle them in generic way,Instead of creating one structure for every fuction type.Please help me.I need the solution very urgent.

Thanks,

Anuradha.

Outcomes