Zack Li Zack Li - 1 month ago 5x
C Question

C pass pointer as argument in function

I came across the following code:

int H3I_hook(int (*progress_fn)(int*), int *id)

I don't understand the purpose of
at the end of the first argument?



int (*progress_fn)(int*)

it can be interpreted like below:

int (*progress_fn)(int*)
 ^       ^          ^
 |       |          |___________ pointer to integer as argument
 |       |                                          ^
 |     pointer to any function that has | and takes |
 |                                      V
 |__________________________return type an integer