store and retrieve array of chars in flash memory

Why byte-by-byte?

I said "byte to byte" because I disregarded the cstring.h commands. But I'm already getting a better idea how to use PROGMEM based on the examples and suggestions given so far.

Do you mean, why can I read but not write?

In my original sketch, I did the following:

  • I saved char arrays in flash (STR_0, STR-1 ...);
  • I saved an array of pointers to these strings (STR []) in the flash as well;
  • I declare a char array that serves as buffer (buff [17]).
  • I created a function that copies one of these strings into the buffer, concatenates that buffer with the next string and prints the buffer on the serial monitor.

This process of copying and concatenation, when written repeatedly for each pair of strings, results in the printing of the two concatenated strings.

However, when you replace the code fragments that copy, concatenate, and print, for a for loop, the program has an error.

I wanted to understand why one process gives the right result and the other does not.