I don't like the idea of saving, anywhere, a pointer to a local variable
char const * buffer[2];
void loop() {
const char * const &local_string = "Will this string survive until second call to print_buffer()?";
print_buffer();
buffer[1] = local_string;
}
The good thing about this modification is the local variable is only a reference to a global pointer, not a local pointer. And there is no cast needed.