E
eagle_jyjh
For example:
the
msg = temp_buf;
is alwawys ok?
//test_msg.cpp
struct msg_head
{
char a01[4];
char a02[4];
char a03[4];
char a04[4];
char a05[4];
char a06[4];
char a07[4];
char a08[4];
char a09[4];
char a10[4];
char a11[4];
};
int main(void)
{
struct msg_head * msg;
char *p_temp_buf = new char[2024];
...
msg = (struct msg_head *)p_temp_buf;
...
delete p_temp_buf;
return 0;
}
the
msg = temp_buf;
is alwawys ok?
//test_msg.cpp
struct msg_head
{
char a01[4];
char a02[4];
char a03[4];
char a04[4];
char a05[4];
char a06[4];
char a07[4];
char a08[4];
char a09[4];
char a10[4];
char a11[4];
};
int main(void)
{
struct msg_head * msg;
char *p_temp_buf = new char[2024];
...
msg = (struct msg_head *)p_temp_buf;
...
delete p_temp_buf;
return 0;
}