0

I am new to C programming, I am trying to understand the following code:

typedef eMBErrorCode( *peMBFrameSend ) ( UCHAR slaveAddress,
                                         const UCHAR * pucFrame,
                                         USHORT usLength ); 

Could any one explain how does this code works?

Matteo Italia
  • 123,740
  • 17
  • 206
  • 299
Shement
  • 1
  • 1
  • 3
    This code declares `peMBFrameSend` to be a type alias for "pointer to a function returning `eMBErrorCode` and taking arguments `UCHAR slaveAddress, const UCHAR * pucFrame, USHORT usLength`". – Matteo Italia Jul 16 '18 at 21:48
  • It's a function pointer, see the linked duplicate. – Lundin Jul 16 '18 at 21:56
  • 2
    [int( *peMBFrameSend ) (char, const char *, short)](https://cdecl.org/?q=int%28+*peMBFrameSend+%29+%28char%2C+++const+char+*%2C++short%29%3B+) may help – chux - Reinstate Monica Jul 16 '18 at 23:02

0 Answers0