Hello,
I have a set of over 50 different arrays, and I need to be able to reference them in a simple way so that I can minimize the code (obviously the goal, right?)
So here is an example of the core arrays:
unsigned int aryMenu[] = {4400, 4400, 550, 1650, 550, 1650, 550, 1650, 550, 550, 550, 550, 600, 550, 550, 550, 550, 550, 550, 1650, 550, 1650, 550, 1650, 550, 550, 550, 600, 550, 550, 550, 500, 600, 550, 550, 600, 550, 1650, 550, 550, 550, 1650, 550, 1650, 550, 550, 550, 550, 550, 600, 550, 1650, 550, 550, 550, 1650, 550, 550, 550, 550, 550, 1650, 550, 1650, 550, 1650, 550};
unsigned int aryGuide[] = {3300,3350,800,2550,750,2550,800,850,800,2500,850,2500,800,900,800,2500,800,2550,800,850,800,850,800,850,800,900,750,900,750,2550,800,900,750,850,800,2550,800,850,800,850,800,2550,800,2500,800,2550,800};
unsigned int aryOK[] = {3250,3350,800,2500,850,2500,800,900,750,2550,800,2550,800,850,800,850,800,2550,800,2500,800,850,800,900,750,900,800,800,850,2500,800,850,800,900,800,2500,800,2550,800,900,750,850,800,2550,800,2500,800};
Then I have an enum like this:
enum CMDS{
ARYMENU,
ARYGUIDE,
ARYOK
}
And this is how I would LIKE to be able to reference those arrays:
void doCommand(unsigned int option[]) {
//do whatever with passed array
}
void runCommand(CMDS cmds) {
unsigned int option[];
switch (cmds) {
case ARYMENU:
option = aryMenu;
break;
case ARYGUIDE:
option = aryGuide;
break;
case ARYOK:
option = aryOK;
break;
}
doCommand(option);
}
But i'm finding it to be not possible to assign one of the pre-defined arrays to a variable array which can then be thrown into another function...
Is there a way to do this?
Thank you,
Mike