abcd12344445555
Programmer
Given the following scenario:
how can I set message.payload.data to NULL .
I cannot change any struct definition.
The statement bellow wont work :
Thanks
Best regards.
P.
Code:
struct a_s{
u_int16_t cmd;
u_int16_t dataSize;
u_int8_t data[MAX_DATA_SIZE];
};
typedef struct a_s a_t;
struct b_s {
u_int16_t part;
u_int16_t serial;
a_t payload;
};
typedef struct b_s b_t;
(...)
b_t message;
how can I set message.payload.data to NULL .
I cannot change any struct definition.
The statement bellow wont work :
Code:
&(message.payload.data) = NULL; // it doesnt work : invalid lvalue in assignment
Thanks
Best regards.
P.