String array length in function
The problem is that LEN is evaluated locally for each usage replacing it with the content. In myFunction the parameter being passed to it is a pointer, not the array.
You need to evaluate the size once and once only in the context where the array hasn't collapsed into a pointer. That is usually done immediately where the array is defined:
const char* mainMenu[] = {&quot;FirstWord&quot;, &quot;SecondWord&quot;, &quot; &quot;}; 
#define MAINMENU_LEN (sizeof(mainMenu) / sizeof(mainMenu[0]))

Because mainMenu is a global it's always available, and when you require the length you get the length of the global array.
If you want to keep things local you will have to pass the number of elements in the array as a parameter to the function that uses that information.
myFunction(mainMenu, MAINMENU_LEN);

Another common alternative is to have some &quot;end of array&quot; marker and you loop through your array until you find that marker (that's how strings work - with \0 for the end of array marker):
const char* mainMenu[] = {&quot;FirstWord&quot;, &quot;SecondWord&quot;, &quot; &quot;, 0}; 

Then:
for (int i = 0; m[i] != 0; i++) {
    ...
}