You cannot initialize an array with values whose values are unknown at compile-time. The values of your struct
are unknown at compile-time and so are not const
expressions.
Whereas 0x1
, 0x2
, ... are const
expressions that can be evaluated at compile-time.
You might declare an array and then set the values during runtime, like
unsigned char rtc_time[6];
...
rtc_time[0] = pThis->hoursTens;
//go on