How to copy string array

Hello guys, im playing with Parola library. Im trying to animate every word on display, and its works fine. But, i dont know how to change these words in runtime.

For example

byte  curText;
char *curMess[] = {
  "Happy New Year"};

// Can be easily replaced with "Merry Christmas" 

strcpy(*curMess, "Merry Christmas");

Thats works fine, but its one animation for all words. But, like i said i want to animate every word on display so i need to put multi quotes like this.

byte  curText;
char *curMess[] = {
  "Happy", "New", "Year"};

char *newMess[] = {
  "Merry", "Christmas"};

/* If i use 
 strcpy (*curMess,*newMess);
Its replace only first word and display like
"Merry New Year"
*/

So, how i can copy words from newMess array to curMess array?

Why are you copying the strings?
Why not just send them to the display, in situ?

P.displayText(curMess[curText], PA_CENTER, SPEED_TIME, PAUSE_TIME, effect[inFX], effect[outFX]);

It's called in Setup scope, if i call it in Loop scope then won't display anything. I don't know why, but in every example sketch it's called in setup scope. So than, how i can change strings?

Please post your code.

// Program to demonstrate the MD_Parola library
//
// For every string defined by pc[] iterate through all combinations
// of entry and exit effects.
//
// Animation speed can be controlled using a pot on pin SPEED_IN
//
// MD_MAX72XX library can be found at https://github.com/MajicDesigns/MD_MAX72XX
//

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4

#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10

// Hardware SPI connection
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// Arbitrary output pins
// MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

int SPEED_TIME = 25;
int PAUSE_TIME = 1000;


#define  BUF_SIZE  95
// Global variables
byte  curText;
char  *curMess[] = {
  "Happy","New","Year"
};
char *newMess[] = {
  "Merry", "Christmas"};

byte  inFX, outFX;
textEffect_t  effect[] =
{
  PA_PRINT,            //  0
  PA_SCAN_HORIZ,       //  1
  PA_SCROLL_LEFT,      //  2
  PA_WIPE,             //  3
  PA_SCROLL_UP_LEFT,   //  4
  PA_SCROLL_UP,        //  5
  PA_OPENING_CURSOR,   //  6
  PA_GROW_UP,          //  7
  PA_MESH,             //  8
  PA_SCROLL_UP_RIGHT,  //  9
  PA_BLINDS,           //  10
  PA_CLOSING,          //  11
  PA_RANDOM,           //  12
  PA_GROW_DOWN,        //  13
  PA_SCAN_VERT,        //  14
  PA_SCROLL_DOWN_LEFT, //  15
  PA_WIPE_CURSOR,      //  16
  PA_DISSOLVE,         //  17
  PA_OPENING,          //  18
  PA_CLOSING_CURSOR,   //  19
  PA_SCROLL_DOWN_RIGHT,//  20
  PA_SCROLL_RIGHT,     //  21
  PA_SLICE,            //  22
  PA_SCROLL_DOWN,      //  23
};

void setup(void)
{
  Serial.begin(9600);
  P.begin();
  P.setInvert(false);
  P.setIntensity(0);
  P.displayText(curMess[curText], PA_CENTER, SPEED_TIME, PAUSE_TIME, effect[inFX], effect[outFX]);
}

void loop(void)
{
  if (P.displayAnimate()) // animates and returns true when an animation is completed
  {
    // Set the display for the next string.
    curText = (curText + 1) % ARRAY_SIZE(curMess);
    P.setTextBuffer(curMess[curText]);

    // When we have gone back to the first string, set a new exit effect
    // and when we have done all those set a new entry effect.
    if (curText){
      inFX = random (1, ARRAY_SIZE(effect));
      outFX = random (1, ARRAY_SIZE(effect));
      P.setTextEffect(effect[inFX], effect[outFX]);
   }
// Tell Parola we have a new animation
    P.displayReset();
  }

}

EDIT:
Never mind about the literal, it won’t be overwritten. But, you still have the array boundary issue.

I wouldn’t try to strcpy() into a char array that’s been allocated by string literals the way you are. #1 - because it’s bad form to overwrite a literal. #2 - you’ll exceed the array boundary if the new string is longer than the original.

Also, as already mentioned, you don’t need to copy the string at all. Just pass a pointer to the one you want.

I’d go with a 2-Dimension array of char pointers. The rows are the message while the columns are the words within the message:

const char * const message[][3] = {
  {"Happy", "New", "Year"},
  {"Merry", "Christmas", ""}
};

Then, nested loops to cycle through.

 for (uint8_t currentMessage = 0; currentMessage < 2; currentMessage++) {
    for (uint8_t currentWord = 0; currentWord < 3; currentWord++) {
      P.setTextBuffer(message[currentMessage][currentWord]);
    }
  }

Your situation is a little messy because one message is 3 words and the other is 2 words. So, I made the 3rd word of the 2nd message null. That could also be handled by using a more complex data structure.