I am trying to write a UDP socket client program. and it seems the networking part is working.
The problem am having is of the way i represent data.
here is the registration message Struct
typedef struct {
char passwd[16];
char username[14];
unsigned short tcpPort;
} RegMsg_t;
main()
RegMsg_t *regMsg //a pointer to the struct
regMsg->psswd = "joy"; //trying to read in the psswd array
// OR
strcpy(regMsg->psswd,"joy"); //a different way of reading in to the array
char outMsg[N]; //Array of the out message( the whole struct)
regMsg= (RegMsg_t *)outMsg; //trying to equate the pointer regMsg and the outMsg array
In the code above Non seems working. those are the two ways m trying to read data in to the struct (THE MAIN QUESION IS HOW TO CHANGE THE STRUCT INTO AN ARRAY
Then the other part is to change this whole struct into an ARRAY for the sento function of the UDP socket
these are the problems holding me up. Can anybody pls help me..
Thnks
This post has been edited by eudos: 01 June 2008 - 02:51 AM

New Topic/Question
Reply



MultiQuote







|