Like the title says, I want to know what "(int (*)())" in a C-define-function-call means?
As example, it looks similar to this:
#define Bla(x) (Char *) read((char *(*)()) Blub, (char **) x)
or this
#define XXX(nx, id) PEM_ASN1_write_bio((int (*)()) id, (char *) nx)
Thank you in advance!
The casts the argument to a pointer to a function that returns char * and takes zero or more arguments. The second function returns int.
You can use a program (and website, now) called "cdecl" to help with these, it says:
(char *(*)()): cast unknown_name into pointer to function returning pointer to char(int (*)()): cast unknown_name into pointer to function returning intThe easiest way of deciphering complex C expressions is to start with the innermost expression, then in an anti-clockwise pattern move on to the next. (int (*)())
A pointer to a function returning int, since it is wrapped in the outer () is because of the macro.
Hope this helps, Best regards, Tom
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With