What is the best way to copy a string form PROGMEM
to a const char[]
?
While something like this would probably work:
#include <avr/pgmspace.h>
const char *pstr = PSTR("Hello");
char str[strlen_P(pstr)+1];
strcpy_P(str, pstr);
const char *cstr = str;
Maybe there is a solution using an initializer_list
object returned by a lambda with pgm_read_byte
inside, similar to http://www.cplusplus.com/forum/beginner/213574/?