We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hello to all of you, is there a way to have a array and give each element of the array a special name? An example:
float my_array[20]; . . for(i=0;i<20;i++) send(my_array[i]; . .
#define actual_temperature my_array[1] #define minimum_temperature my_array[2] #define maximal_temperature my_array[3]
hides the fact that it is an array wheras #define MY_ARR_actual_temperature 1 #define MY_ARR_minimum_temperature 2 #define MY_ARR_maximal_temperature 3
and accessing it by my_array[MY_ARR_actual_temperature] would not
I consider it important that an 'array indicator' e.g. MY_ARR_ be included in the offset name, I have found horrendous bugs where the offset from your_array was used on my_array creating a very tough bug (nobody could 'see' it). e.g. if no 'array indicator' was included, could you spot your_array[actual_temperature] in a reasonable time?
Erik