typedefenum commands
{
cmdConnect = 1,
};
struct Packet
{
commands commmand;
BALL Data; // i actualy want to make this a generic data type
};
void send_packet(BALL data)
{
commands i = cmdConnect;
Packet pack = Packet();
pack.commmand = i;
pack.Data = data;
sendto(Socket, (char*)&pack, sizeof(pack), 0, (sockaddr*)&RemoteAddress,
sizeof(sockaddr));
}
the way it is now i get the data just perfectley to the other side. but what if i want to send lets say my Bat data witch contains the location and speed of that. how would i change Packet to allow for a dynamic data source.