J
Jack
Hi all,
I have a problem. I am writing a client server app in C. In my client
program, I have a simlple struct similiar to:
struct mySt{
int id;
char val;
struct mySt *next;
};
I want to be able to fill out the variables in this struct and then
send it to the server.
I do this using:
struct mySt pStruct;
pStruct.id = 1;
pStruct.val = 'a';
send ( sd, &pStruct, sizeof(struct pStruct), 0);
on the server though, even though I do receive this info. I have no
idea how to parse. I recieve a data in a variable of the same type
(struct mySt), but I don't know how to read it / parse it. Is it read
into char or can I do something like:
struct mySt **receivedPacket;
int id = receivedPacket[0];
Thanks
I have a problem. I am writing a client server app in C. In my client
program, I have a simlple struct similiar to:
struct mySt{
int id;
char val;
struct mySt *next;
};
I want to be able to fill out the variables in this struct and then
send it to the server.
I do this using:
struct mySt pStruct;
pStruct.id = 1;
pStruct.val = 'a';
send ( sd, &pStruct, sizeof(struct pStruct), 0);
on the server though, even though I do receive this info. I have no
idea how to parse. I recieve a data in a variable of the same type
(struct mySt), but I don't know how to read it / parse it. Is it read
into char or can I do something like:
struct mySt **receivedPacket;
int id = receivedPacket[0];
Thanks