Not sure what is "good practice" or considered more "correct". I have an array, I want to access individual elements by names other than arrayname[]. I could use #defines or pointers, probably other ways also.
Example:
#define value1 myarray[1]
int myarray[SIZE];
value1 = 5;
or
int myarray[SIZE];
int *ptr;
ptr = &myarray[1];
*ptr = 5;
Seems to me the #define route is simpler and uses less memory, but could bring up a bunch of issues I am not aware of. Any insight would be great, I like to keep my code following the general accepted standards wherever possible.
*Edit:Maybe there is a better way altogether. My end goal is to get an array that will be sent out a peripheral port. However the data is comprised of very different data sets, and a single array name would not be representative of the data being assigned. My memory is quite limited so I would like to avoid double storing each value.