I am running some older code that uses PROGMEM to stick a bunch of strings into an array for use later.
char* name_last[] PROGMEM = {"Armitage", "Baird", "Baldwin", "Bardsley", "Fisher", "Wyrzykowsi", "Piantella", "Restina", "Molenaar", "Taylor", "Atherton", "Schelter", "Baumgartner", "Burns", "Caldwell", "Chang", "Cowper", "Cox", "Felbrigge", "Foster", "Harper", "Henderson", "Higgens", "Holdeman", "Hunt", "Jolce", "Margaret", "Mordaga", "Osterweiss", "Porter", "Prevatt", "Rodacker", "Rosenstiehl", "Rowley", "Schmidt", "Schneider", "Schreckengost", "Schuleit", "Shafer", "Shaw", "Sheets", "Stall", "Strickland", "Thompson", "Tonkin", "Vinsant", "Ward", "Wheeler", "Wolfe", "Young"};
#define array_last_length ((sizeof(name_last)/sizeof(char *)))
But, I am new getting an error that states:
error: variable 'name_last' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
I have found the more modern way of updating the code so it works, but it would require tons of code like:
const char male_0[] PROGMEM = "Asa";
const char male_1[] PROGMEM = "Avery";
const char male_2[] PROGMEM = "Benedict";
const char male_3[] PROGMEM = "Cameron";
const char male_4[] PROGMEM = "Casey";
const char male_5[] PROGMEM = "Claude";
These strings are input from a separate system, and I would REALLY like to avoid having to write a single line of code for each one. What changed, and how can I use my old code again?
Thanks,
Ryan