problem passing pointers to function

In my code I can pass one element of a pointertable to char arrays but not all. Any idea.

#include <avr/pgmspace.h>
const char string_0[] PROGMEM = "String 0";   // "String 0" etc are strings to store - change to suit.
const char string_1[] PROGMEM = "String 1";
const char string_2[] PROGMEM = "String 2";
const char string_3[] PROGMEM = "String 3";
const char string_4[] PROGMEM = "String 4";
const char string_5[] PROGMEM = "String 5";


// Then set up a table to refer to your strings.

const char* const string_table[] PROGMEM = {string_0, string_1, string_2, string_3, string_4, string_5};

char buffer[300];    // make sure this is large enough for the largest string it must hold
int ii;
void setup()
{
  Serial.begin(115200);
  while(!Serial);

}


void loop()
{
Serial.println("Buffered:");
  for (int i = 0; i < 6; i++)
  {
    if (i==0) { //1ste x !! cpy
      strcpy_P(buffer, (char*)pgm_read_word(&(string_table[i])));
    } else  {// verder cat
      strcat(buffer," -*- ");
      strcat_P(buffer, (char*)pgm_read_word(&(string_table[i])));

      }
    }
  Serial.println(buffer);
  
  Serial.print("not buffered (2 ways) : 1 element 0   first way:");
  Serial.println ((const __FlashStringHelper *) string_table[0]);// Printen van FlashMEM!!
   Serial.print("not buffered: second way:");pF(string_table[0]);

  Serial.println("not buffered all of them:");
  for (ii=0;ii<6;ii++) 
  {
    pF(string_table[ii]);
  }

  Serial.println("-------------");
  delay(25000);
}

void pF(char * p){
  //Serial.print("buffer is=");Serial.println(buffer);
  //Serial.print("p is=");
  Serial.println((const __FlashStringHelper *)p);
  }

my output is not ok (garbage) when using 'pF(string_table[ii])' instead of 'pF(string_table[0])':

Buffered:
String 0 -*- String 1 -*- String 2 -*- String 3 -*- String 4 -*- String 5
not buffered (2 ways) : 1 element 0   first way:String 0
not buffered: second way:String 0
not buffered all
⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮

Someone can help?

Something that will lead to confusion, this line will not actually work as written:

Serial.println ((const __FlashStringHelper *) string_table[0]);

Since you are printing one specific element of the array, the compiler is optimizing the code by eliminating the reference to string_table[0] and instead directly coding in the char * that is stored in string_table[0]. If you substituted a variable instead of the direct reference to [ 0] the code will not work. It should be written as:

Serial.println ((const __FlashStringHelper *) pgm_read_word(&string_table[0]));

Similarly, the call to pF() should use the same syntax:

pF(pgm_read_word(&string_table[ii]))

david_2018:
Something that will lead to confusion, this line will not actually work as written:

Serial.println ((const __FlashStringHelper *) string_table[0]);

Since you are printing one specific element of the array, the compiler is optimizing the code by eliminating the reference to string_table[0] and instead directly coding in the char * that is stored in string_table[0]. If you substituted a variable instead of the direct reference to [ 0] the code will not work. It should be written as:

Serial.println ((const __FlashStringHelper *) pgm_read_word(&string_table[0]));

Similarly, the call to pF() should use the same syntax:

pF(pgm_read_word(&string_table[ii]))

Thanks!! I have put this complex code in a macro: #define DM(...) Serial.println((const __FlashStringHelper *) pgm_read_word(&VA_ARGS)) and use it a in DM(string_table[ii]);