I'm trying to send a struct to a DGRAM socket. Here's what i'm doing:
client (sends struct)
serverCode:n = sendto(socket_fd,(const char*)&mypdu,sizeof(mypdu),0, (struct sockaddr *)&server_addr,sizeof(server_addr));
but in the client, i initialized one of the fields with 100, and in the server end, that field has the value 3 =\Code:n=recvfrom(socket_fd,buffer,sizeof(mypdu),0, (struct sockaddr *)&from,&fromlen);
Can I send the whole struct without sending it field by field?