Original Post
Hey,
I've got a lobby server and would like to send to it some info. I thought that I would make structure which contains nickname and user's message text. However I dont want to send a structure like:
becouse it's not efficient. Users might have less letters in nick than 20 or type less text than 255 chars and that would be a waste of time sending such a structure everytime... I guess it's impossible to send a pointer becouse it doesn't make any sense... I know I could merge those 2 arrays into 1 and send not a sturct but just char string but there will probably be some more elements to send for each user and I would like to have it all in one structure
I would be evry grateful for help!
I've got a lobby server and would like to send to it some info. I thought that I would make structure which contains nickname and user's message text. However I dont want to send a structure like:
struct data
{
char nickname[20];
char text[255];
}
becouse it's not efficient. Users might have less letters in nick than 20 or type less text than 255 chars and that would be a waste of time sending such a structure everytime... I guess it's impossible to send a pointer becouse it doesn't make any sense... I know I could merge those 2 arrays into 1 and send not a sturct but just char string but there will probably be some more elements to send for each user and I would like to have it all in one structure
I would be evry grateful for help!