I have a structure (this is kinda irrelevant for my question), and in this structure, a DATE type is used.
typedef div_t DATE;
#define ans quot /* (s)(l)div_t : .quot -> .ans... */
#define mois rem /* ... et .rem -> .mois : plus parlant */
DATE is of type div_t containing a year as quot and a month (mois) as rem. (… 🙂 )
Anyhow.
I would like to make an array of elements for this DATA (div_t) type.
This seems to work as follows:
DATE tx_tech_variable_dates_vec[8] = {0, 0}; /* code testing */
However, I don’t know how to assign elements (year/quot, mois/rem) to this array:
This does not work:
DATE tx_tech_variable_dates_vec[0].quot = { 2026, 06 }; /* code testing */
DATE tx_tech_variable_dates_vec[0].rem = { 2026, 06 }; /* code testing */
//DATE tx_tech_variable_dates_vec[1].ans = { 2026, 07 }; /* code testing */
//DATE tx_tech_variable_dates_vec[1].mois = { 2026, 07 }; /* code testing */
//DATE tx_tech_variable_dates_vec[1] = { 2032, 06 }; /* code testing */
Any idea how to create an array of “DATE”(s)/div_t elements and assign elements (quot, rem) to it?