Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
typedef facility allows us to define a new nam for an existing data type...... here in the above expression When this exception handler function is called, the parameter Data pointer contains the same value as you provided when you registered the handler.
where SendHandler defined above is an element of structure variable Inst
and stub is defined as
static void stub (void)
My main doubt is when we typecast the stub function to a pointer to a function, it should pass the address of the function to the SendHandler function pointer in the structure, but can't understand how it does so?
Although it's problematic to discuss incomplete code snippets, two points are obviously wrong:
- a function pointer can be assigned to the address of a function, not the function itself
- void (pf1 *)(void) and void (pf2 *)(void * data) aren't assignment compatible