Hello all,
I encounter problem with memcpy in C. Here is the code :
typedef struct {
CPY_IM009_DEF
}message;
message msg;
with CPY_IM009_DEF is a struct in other files. Then I try this
char wx_msg_buf[8192];
memset(wx_msg_buf, 32, sizeof (wx_msg_buf));
memcpy(wx_msg_buf, &msg, sizeof (msg));
when I check the size :
sizeof (msg) = 2140
sizeof (wx_msg_buf) = 8192
But when I check the wx_msg_buf, memcpy only copy part of msg to wx_msg_buf (200 from 2140). What I want to know is why does this happen?If more code required please tell me
Thanx you for the help.