String to Arrayname...?

Hey there!
it might be stupid, but im kinda new to arduino or C++. I tried my best with google & friends and my brain.

i want to store the name of an array in a string, so that i can manipulate it later.

String menu_name = "main_menu";
String main_menu[] = {"item1", "item2", "item3"};

dosomething(menu_name);

void dosomething(String bla[]) {
 // do something with the "main menu" array
}

can anyone help with the kind of thing i'm looking for? Or tell me where i'm wrong?
thanks in advance!

When the compiler gets done, all variable names (including arrays) have been mapped to addresses. Only the addresses are known. Trying to do something to an array, based solely on its name at run time, is NOT possible.

Using the String class is not advisable, either. Passing an array of String objects to the dosomething() function doesn't seem reasonable, either.

As Paul said, the Arduino has no idea that the array you've created is called "main menu"

The closest you can get is to create a hashtable which stores the character string and the array, but it's not recommended considering the limited SRAM on the Arduino. There is usually a better way to accomplish your overall goal.

aha! thanks a lot! i will work further and look for a workaround... cheers!