iterate through values in an array of strings to print I (think I) am trying to iterate through the values of an array and print the string to a tft. I have declared the array of 4 strings, and that works fine. But when I try to print it, I get garbage. Am I missing a nuance of print? Or do I just not understand how to use arrays and strings...?

The code is as follows:

Declarations:

//Active System
char hvacSystems[4][5] = {"Off", "Fan", "Cool", "Heat"};
int activeSystem = 0;  
String displayActiveSystem = hvacSystems[activeSystem]; &lt;-- Should now be String "off"


Use (note the fake if statement for the question)

  if(systemNeedsToBeCycled){
    activeSystem++;
    displayActiveSystem = hvacSystems[activeSystem]; &lt;-- Should now be String "Fan"
    tft.print(displayActiveSystem);
  }


Instead I get random characters most of the time, sometimes nothing.

In case its a memory thing, please know that:

Sketch uses 26,480 bytes (92%) of program storage space. Maximum is 28,672 bytes. Global variables use 1,126 bytes (43%) of dynamic memory, leaving 1,434 bytes for local variables. Maximum is 2,560 bytes.
I think this is the correct way to create an array of C strings:

    char * hvacSystems[] = {"Off", "Fan", "Cool", "Heat"};
    int activeSystem = 0;  
    char * displayActiveSystem = hvacSystems[activeSystem]; 

    if(systemNeedsToBeCycled){
        activeSystem++;    // make sure to set a bound for this variable
        displayActiveSystem = hvacSystems[activeSystem]; 
        tft.print(displayActiveSystem);
    }


Since strings are basically stored as char pointers so an array of strings is an array of char * variables. Or you could create an array of Arduino strings:

    String hvacSystems[] = {"Off", "Fan", "Cool", "Heat"};
    int activeSystem = 0;  
    String displayActiveSystem = hvacSystems[activeSystem]; 

    if(systemNeedsToBeCycled){
        activeSystem++;    // make sure to set a bound for this variable
        displayActiveSystem = hvacSystems[activeSystem]; 
        tft.print(displayActiveSystem);
    }