c++ - Issue with Conversion from struct to char * -


i have struct of size 57 bytes when convert char *, size of char * variable shows 4 bytes. problem this?

code:

struct overhead{      unsigned char flags;     unsigned short int seqno, timediff, threshold, length;    };      struct payload{      double forcex,forcey,forcez,positionx,positiony,positionz;  };   struct packet{      overhead fields;     payload data;  };  packet pack;  // assigning values struct members.  char * message = (char *)pack;  retval = send(conn_socket, message , sizeof(message), 0); 

edit:

at receiver, if char * typecasted packet *, strut members not values assigned @ sender. why so?

char* pointer (i.e. memory address) 32 bit (on 32 bit platform); 4 bytes.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -