Joe Kissell

Text table values not located near each other in memory

Discussion created by Joe Kissell on Dec 20, 2011
Latest reply on Dec 20, 2011 by Joe Kissell

I have the following list of text values defined in my code.

 

static char const * const daylight_savings_time_tbl[ TIME_DAYLIGHT_SAVINGS__CNT ] =    {    /* TIME_DAYLIGHT_SAVINGS__OFF  */ "Off",    /* TIME_DAYLIGHT_SAVINGS__ON  */ "On",    /* TIME_DAYLIGHT_SAVINGS__AUTO     */ "Auto"    };

Unfortunatly, these text values don't all show-up together in RAM (see image below). Is there another way I can declare this table?

It's rather critical to what I'm trying to accomplish. Because my function is handed many tables of strings like this one, I have it simply search for the NULL character and assume the start of the next string is the next character.

 

MCU Memory

Outcomes