It's a pointer, named ptr, to a function that returns an int and takes no arguments (i.e., int ()
).
The syntax isn't beautiful, but it's like a function signature, except the second part identifies that this is a pointer to such a function, with a certain name (ptr in this case).
This tutorial might be of help in understanding the principles (excerpt follows):
int (*pt2Function)(float, char, char) = NULL; // C
int DoIt (float a, char b, char c){ printf("DoIt\n"); return a+b+c; }
int DoMore(float a, char b, char c)const{ printf("DoMore\n"); return a-b+c; }
pt2Function = DoIt; // short form
pt2Function = &DoMore; // correct assignment using address operator