I have a struct which has several arrays within it. The arrays have type unsigned char[4].
I can initialize each element by calling
struct->array1[0] = (unsigned char) something;
...
struct->array1[3] = (unsigned char) something;
Just wondering if there is a way to initialize all 4 values in one line.
SOLUTION: I needed to create a temporary array with all the values initialized, then call memset() to copy the values to the struct array.
If the values are the same, you might do something like
Otherwise, if the values are stored in an array, you can use the memcpy function like so