So I have a function called sockio() that takes a function pointer for either the send() or recv() functions in Winsock 1.1 but I get an error when I try to pass either as an argument of my function pointer type iofunc, defined below.
I can't seem to make them match up so that it'll let me pass in send() or recv(), why is this?
// my function pointer typedef
typedef int (*iofunc)(SOCKET, const char*, size_t, int);
// sockio function prototype
static int sockio(int socket, sockio_buf* buf, iofunc io);
Heres the error it gives me when I try to compile in Visual C++ 2010:
1>c:\...\sockio.c(24): error C2440: 'function':
cannot convert from 'int (__stdcall *)(SOCKET,const char *,int,int)' to 'iofunc'
1>c:\...\sockio.c(24):
warning C4024: 'sockio': different types for formal and actual parameter 3
All the parameters look the same to me. Is it anything to do with the (__stdcall *) bit?