user23997: Is it possible to use a name instead of a number to address an array? I was reading about enum lists and thought it might be possible.
ie 
int array[3] = {something, somethingElse, somethingMore]
array[second] => somethingElse
I am asking as I have an array looking after flags for several functions and would like to be able to use the function name instead of a number to address the array.
bool flag[6] = {1, 1, 1, 1, 1, 0}; // Power, Jump 3, Jump 7, Fade 3, Fade 7, Pause active


user4143: No, but you can use a struct:
struct flags {
    uint8_t power;
    uint8_t jump3;
    uint8_t jump7;
    .... etc ....
};

struct flags myFlags;

myFlags.power = 1;
if (myFlags.jump3) {
    .... stuff ....
}

Or you can continue to use a simple numeric array and assign names to the numbers, either with #define, const variables, or an enum.
enum flags {
    power, jump3, jump7, fade, fade7, pause
};

bool flag[6] = {1, 1, 1, 1, 1, 0};

flag[power] = 1;
if (flag[jump3]) {
    .... whatever ....
}


23997: <p>Is it possible to use a name instead of a number to address an array? I was reading about enum lists and thought it might be possible.
ie 
int array[3] = {something, somethingElse, somethingMore]</p>

<p>array[second] => somethingElse</p>

<p>I am asking as I have an array looking after flags for several functions and would like to be able to use the function name instead of a number to address the array.</p>

<pre><code>bool flag[6] = {1, 1, 1, 1, 1, 0}; // Power, Jump 3, Jump 7, Fade 3, Fade 7, Pause active
</code></pre>
 4143: <p>No, but you can use a <code>struct</code>:</p>

<pre><code>struct flags {
    uint8_t power;
    uint8_t jump3;
    uint8_t jump7;
    .... etc ....
};

struct flags myFlags;

myFlags.power = 1;
if (myFlags.jump3) {
    .... stuff ....
}
</code></pre>

<p>Or you can continue to use a simple numeric array and assign names to the numbers, either with <code>#define</code>, <code>const</code> variables, or an <code>enum</code>.</p>

<pre><code>enum flags {
    power, jump3, jump7, fade, fade7, pause
};

bool flag[6] = {1, 1, 1, 1, 1, 0};

flag[power] = 1;
if (flag[jump3]) {
    .... whatever ....
}
</code></pre>
