I have a structure which contain a long array. I know that possible initialize an array when defined:
uint8_t array[] = {0x10, 0x11, 0xa2, 0xa5};
My question is: is it possible to set all elements of an array after declaration in one operation? Actually, this is a variable of a stucture.
struct example
{
uint8_t long_array[256];
};
And after creating an instance I want to set all elements for long_array
to different values in one operation. If it is not possible, what is the simplest way to set all elements?
There is a pseudocode what I want to do:
struct example ex;
ex.long_array[] = {0x01, 0x07, 0x9a, 0xd1, <...>};
Thanks for your help!