I have an array of 255 elements. I need to store 100 values in this array. For example, if there are 3 items rose, red, rat then arr[0] should represent rose, arr[1] should represent red and arr[2] as rat. Then these values are assigned as arr[0] = 100, arr[1] = 200, arr[2] = 300. Now when I want to get the value of rat I should be able to get the value directly by accessing its index i.e arr[2]=300. My idea is to create macros and assign values to each items and directly access the value in array.
Example:
#define ROSE 0
#define RED 1
#define RAT 2
Then directly for rat I will say arr[RAT] to get the value. Is this a good approach for 100 items?
ADDITION:
Now what if the size of values of items vary? For ex. red has the 4bytes value and rat has 2bytes value, then for uint8 arr[255]; red should starts at arr[1] and rat should start at arr[5]. Does enum still work here?