Initializing a member from struct to the direction of an external function
Let's say I have this
typedef struct qwerty {
void *f;
} qwerty_t;
and I want to do this
static qwerty_t x = {
.f = (void *)some_external_function
};
I'm getting error: initializer element is not constant because (if I
understand correctly) the direction of some_external_function is unknown
when I'm compiling.
If that is not the correct explanation of the error, please explain what is.
Also, how can I initialize .f to the direction of that function?
No comments:
Post a Comment