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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…