I want to get values of a global array in a c file. the print screen of code is shown below:
'data' is the global array and 'slave_buffer_rx' is another global array defined in this file to get values of 'data'.each red cross has two errors:
- Error[Pe094]: the size of an array must be greater than zero
- Error[Pe028]: expression must have a constant value
I know how to get rid of errors: make assignments in a local function. the code without errors is shown below:
But I do not known the exact reasons and how can IAR consider it as an array with zero length. Can anyone give me some ideas?