Hi all!
I want to send a struct data to the pc throw internet,
for example
typedef struct _rect{
BYTE x;
short y;
int width;
BYTE height;
}RECT;
when i use the send function,usually i will use in the follow ways:
RECT rdata;
send(&rdata,sizeof(RECT )),
however, the sizeof(RECT ) is not the real size i want to send,because the BYTE alignment,
in vc6.0, this can be solved in the follow way:
#pragma pack(1)
typedef struct _rect{
BYTE x;
short y;
int width;
BYTE height;
}RECT;
#pragma pack()
but in dm642 ,
this result in "warning: unrecognized #pragma",
so how to do "#pragma pack(1)" in dm642,or is there any better ways can be used ?
i also see the #pragma STRUCT_ALIGN (type, constant expression);
but it does not work.
Thanks in advance. Your help will be greatly appreciated!