Concatenate and convert variables

I'm building a display with 8x8 LED matrix . I used this code and it worked well:

However , I would like to insert the text via serial and repeating this. In the code snippet below you can see that it shows the display text from the serial, but only once.

I could not , because of the different types of variables, put the contents of Serial.read to a string variable.

...
char string1[] = " Test text  ";
char serialstring [] = "";  ----> here I should initialize a variable,  empty,  same type of string1.

void setup(){
  m.init(); 
  m.setIntensity(0); 
  Serial.begin(9600);
}

void loop(){
  
  // this is the code if you want to entering a message via serial console
    while (Serial.available() > 0){
    byte c = Serial.read();
   serialstring = serialstring + c ----> Here concatenate the value of c, converted to char or string (not too sure)
    Serial.println(c, DEC);
    printCharWithShift(c, 100);
  }
  delay(100);
  m.shiftLeft(false, true);
 
  // print the active sentences
  printStringWithShift(string1, 100);
  printStringWithShift(serialstring, 100);  ----> here show variable content in display

}

Indicated in the code my idea but do not know how to do it. How can I do this?

Regards!

Wouldn't it be easier to capture all of the input into a buffer at once? If you are using Serial.read() and the message is never longer than 20 characters, then the newline character ('\n') marks the end of the input. Then something along the lines of:

char message[21];   // The extra character is for the null
int charsRead;
// you code setting things up...
    while (Serial.available() > 0){
      charsRead = Serial.readBytesUntil('\n', message, 20);
      message[charsRead] = '\0';    // Now you can treat it as a string...
// The rest of your code...
   }

I could not , because of the different types of variables, put the contents of Serial.read to a string variable.

What "different types"? Serial.read() can store data in a char variable. A "string variable" is a NULL terminated array of chars. A PERFECT match.

char serialstring [] = "";  ----> here I should initialize a variable,  empty,  same type of string1.

Rubbish. Here you just reserved space for one character. You don't need an array for that.

Either you supply enough initializers, and let the compiler count them to size the array, or you define the size of the array.

Thank you for replies!

Worked well:

...
char message[21] = "Inicial message"; // The extra character is for the null
int charsRead;

void setup(){
m.init(); // module initialize
m.setIntensity(0); // dot matix intensity 0-15
Serial.begin(9600); // serial communication initialize
}

void loop(){
// this is the code if you want to entering a message via serial console
while (Serial.available() > 0){
charsRead = Serial.readBytesUntil('\n', message, 20);
message[charsRead] = '\0';
}
delay(100);
m.shiftLeft(false, true);

printStringWithShift(message, 100);
...