I have a server and a client program written and I have a struct named JCPPM that is the struct that holds my packet of data I send between the program. I have this code in my server program:
Code:
case FD_READ:
recv((SOCKET)wParam,(struct JCPPM *)&JCPPpacket,sizeof(struct
JCPPM),0);
if(strcmp(JCPPpacket.data,"")!=0)
ConsoleMessage("",JCPPpacket.data,false);
break;
Obviously the declared instance of my JCPPM struct is JCPPpacket. This particular case I'm trying to receive a packet of the exact same setup(even same naming system since client and server have been written by me). The ConsoleMessage function is my custom function and no errors arise from that so don't worry about that. Up further I have this code:
Code:
struct JCPPM
{
unsigned int type;
char *sender;
char *data;
};
struct JCPPM JCPPpacket;
And I probably have given more info than needed BUT I get this error on my recv function:
Code:
132 C:\WINDOWS\Desktop\JCPPChat\main.cpp cannot convert `JCPPM*' to `char*' for argument `2' to `int recv(SOCKET, char*, int, int)'
A typecasting error that I didn't expect. I thought the recv function took any kind of type to receive to. Anybody know what's my problem? Thanks.