I defined a pointer to a function type:
typedef uint32_t (*funct_t)(bool);
I declared a function that uses the same interface:
uint32_t a_funct(bool);
I need to use the pointer to a function type instead. How can I do that?
I defined a function type:
typedef uint32_t (*funct_t)(bool);
No, you did not declare a function. You declared pointer to a function type.
To declare a function type you could write
typedef uint32_t funct_t(bool);
and then you can use the type to declare the function a_funct
funct_t a_funct;
Take into account that you may not use a typedef of a function type to define a function.
If you define the typedef like this:
You can declare the function like this:
Note that when you define the function, you still need to spell out the parameters.