Doubt regarding C structures and arrays. Quick suggestions please

cyrux

Adept
I have a doubt regarding C pointers, structures and arrays.

I have a structure

typedef nx_struct DataMsg {

nx_uint16_t destID;

nx_uint16_t sourceID;

nx_uint16_t valueReported[100];

} DataMsg;

I have a variable named a .

a[100] ={100 values}

I have a pointer created for a datapkt

DataMsg* datapkt = (DataMsg*) (call RadioPacket.getPayload(&radiopkt, NULL));

i need to set the array of the structure to the value of a

isnt this right

datapkt->valueReported = a; ?

Gives me an error saying , invalid lvalue in assignment

The data types mentioned above are similar to regular int
 
Back
Top