What does (int (*) ()) mean in a function call

As in the title, I want to know what "(int (*) ())" in C-define-function-call means?

As an example, it looks something like this:

#define Bla(x)    (Char *) read((char *(*)()) Blub, (char **) x)

or

#define XXX(nx, id)     PEM_ASN1_write_bio((int (*)()) id, (char *) nx)

Thank you in advance!

+3
source share
5 answers

Casts an argument to a pointer to a function that returns char *and accepts zero or more arguments. The second function returns int.

You can use a program (and a website, now) called cdecl "to help with this, she says:

  • (char *(*)()): cast unknown_name to a pointer to a function that returns a pointer to char
  • (int (*)()): cast unknown_name to a pointer to a function that returns int
+9
source

C - , . (int (*)())

  • (*) , (, , )
  • (*)() , (, )
  • int (*)() , int, int, )
  • (int (*)()), , (, ,

, int, external() - .

, , ,

+3

(int (*)()) - , int (*)(). , , , " , , int ".

, , C: , , C, .

, ​​, :

int (*fp)();

, , (*fp)(), int: " fp, , , int ".

, typecast fp , : (int (*)()).

+1

, read Blub , char * .

0

, " , char" " char" . Bla, Bla (x), !

, PEM_ASN1_write_bio " , int". - " char". XXX (a, b) PEM_ASN1_write_bio (b, a),

0

Source: https://habr.com/ru/post/1723895/


All Articles