Hi to C programming expert
I am not an expert in C. I am trying to find answer for http://stackoverflow.com/questions/3993762/php-passing-c-struct-data-throught-socket-programming/3996282#3996282
Therefore I am starting a new thread to ask specifically on C language
below is the data:
typedef struct
{
UI2 todo;
char rz[LNG_RZ + 1];
char saId[LNG_SAT_ID + 1];
char user[LNG_USER + 1];
char lang[LANGLEN + 1];
SI4 result;
UI4 socket;
char text[LNG_ALLG + 1];
char filename[MAX_PATHLEN];
} dmsAuf_Head;
And this data is required to be send through socket via this:
rval = send(dms_aufHead->socket, (char *) dms_aufHead, sizeof(dmsAuf_Head), 0);
Why is it required to type cast the data via
(char *) dms_aufHead
before sending through socket?
Could you guys guess? Do you mind explaining in abit layman term. Thank you.