Here is a code snippet.
class NetworkRequestChannel {
public:
...
NetworkRequestChannel(const unsigned short _port_number,
void * (*connection_handler) (int *));
...
private:
...
}
My question is about the argument void * (*connection_handler) (int *). I have a vague idea how to read that, and it's as a void pointer to an object named connection_handler that is being then cast to an int pointer. But I know that's almost certainly wrong, and I'm not sure how else to interpret it.
int*as an argument and returns avoid*value (a generic memory address). The parameter itself is namedconnection_handler.class NetworkRequestChannelindicates that this is C++, not C. The answer is the same, but the code shown is not valid C..Cand.Hextensions. However, HE uses classes even in his own predefined files, and the makefile we are given usesg++ -g. It's like some C/C++ hybrid that he's trying to do that I haven't seen up until this class.