I have the following structure in my header file structure.h. Now i need to use this structure in my main.c file.
I need to fill this structure with some values and I need to send this from TCP/IP client to the TCP/IP server on the same system.
#ifndef STRUCTURE_H
#define STRUCTURE_H
typedef struct
{
unsigned int variable3;
char variable4[8];
}NUMBER_ONE,*PNUMBER_ONE;
typedef struct
{
unsigned int variable5;
char variable6[8];
}NUMBER_TWO,*PNUMBER_TWO;
typedef struct
{
char name[32];
unsigned int a;
unsigned int b;
NUMBER_ONE variable1;
NUMBER_TWO variable2;
}NUMBER_THREE,*PNUMBER_THREE;
#endif
I have tried this but, I am not good in C, so please can anyone tell me how to do it, by taking the above structure as an example? Till socket connection establishment is ok for me, but after establishing connection, how do I send this structure from the client to the server?
I am doing this in my Linux Ubuntu 12.04 system.