Different between Array and PROGMEM

Hello Everybody.

Example :
This is normal Array :

char *string_table[] = 
{
    "String 1",
    "String 2",
    "String 3",
    "String 4",
    "String 5"
};

And this is add to memory :

char string_1[] PROGMEM = "String 1";
char string_2[] PROGMEM = "String 2";
char string_3[] PROGMEM = "String 3";
char string_4[] PROGMEM = "String 4";
char string_5[] PROGMEM = "String 5";

I used to normal Array , but i ussually see PROGMEM in some codes Led Matrix about font.
Can you explain and give me some examples.pde , different between Array and PROGMEM ?
Thanks.

PROGMEM is a compiler directive that tells it to store those string alongside the code, in program flash memory. To be used, those strings have to be copied into RAM at runtime using special functions.

An array is a "normal" variable, i.e. one that sits in RAM like all the others, and doesn't require special code to be accessed.

Search for PROGMEM inside this website and you'll find plenty of info.

:slight_smile:

HTH