C arrays cannot be assigned. You cannot assign anything to the entire array, no matter what syntax you use. In other words, this
scan_list = { { eepcal[1], eepcal[2] }, {-1, -1} };
impossible.
In C89 / 90 you will need to specify your line items
scan_list[0].wrdtr = eepcal[1]; scan_list[0].clktr = eepcal[2]; scan_list[1].wrdtr = -1; scan_list[1].clktr = -1;
In modern C (post-C99), you can use complex literals to assign entire structures
scan_list[0] = (struct sdram_timing) { eepcal[1], eepcal[2] }; scan_list[1] = (struct sdram_timing) { -1, -1 };
Finally, in modern C, you can use memcpy and complex literals to copy data to an array
memcpy(scan_list, (struct sdram_timing[]) { { eepcal[1], eepcal[2] }, {-1, -1} }, 2 * sizeof *scan_list);
The latter option, although not very elegant, is the closest way to "emulate" the purpose of the array.
source share