I have a complex query,
I have a structure some thing like this,
typedef struct mod_Definition_T_Tag
{
int x;
char y;
float p;
} mod_Definition_T;
if in the code if the declaration is made as follows:
typedef mod_Definition_T *(*create_func_t)(const char *config_str);
what does this indicate or how do we put them in plain english statement ?
|
Go4Expert Member
|
|
| 10Oct2008,19:47 | #2 |
|
Is there any way by which we can access a function using the functions address alone?
|
|
Ambitious contributor
|
|
| 10Oct2008,21:22 | #3 |
typedef mod_Definition_T *(*create_func_t)(const char *config_str);This declares a function pointer type called "create_func_t". It takes a const char* as an argument and returns a mod_Definition_T *.A simpler example of a function pointer declaration is: typedef int (*func) (int);This declares a function pointer type called func which takes an intand returns an int. You define function pointer variables from it like this:func a, b, c; // a, b, and c are function pointers of type func.And you can use the function pointers just like regular function names: int x = a(5);Your original example might be used something like this: create_func_t cft;Quote:
|
