I have a header file defines some code shown below:
typedef uint8_t EnrollT(uint16_t test1, uint16_t test2);
typedef void ChangeT(uint64_t post1, uint8_t post2);
struct ClusterT * ClientAlloc(EnrollT *, ChangeT *);
I have the following questions:
Is the following code equal?
typedef uint8_t EnrollT(uint16_t test1, uint16_t test2); typedef uint8_t (*EnrollT)(uint16_t test1, uint16_t test2);
In the C file that includes this header, how can I handle these two arguments in the ClientAlloc function? Sample code will be great to me.
========================================================================
Thanks for your replies. By having two real functions, I pass those to the following code:
ClientAlloc(Enroll, Change)
However, when I compile the code, I got the following errors, is anything I missing here?
expected declaration specifiers or ‘...’ before ‘Enroll’
expected declaration specifiers or ‘...’ before ‘NotifyChange’