#! /usr/bin/tcc -run

#include <stdio.h>
#include <stdlib.h>
#include <string.h>


typedef struct slot
{
    ssize_t size;
    char *row;
}   slot;

    slot line;
    slot *text;

    char *ptr;

int main(void) {

    ptr = "this is my story";

    line.row = ptr;
    line.size = strlen(ptr);

    text = malloc(10*sizeof(slot));
    
    text[0] = line;
    printf("text[0].row = %s\n",text[0].row);

    ptr = "this is my song";
    line.row = ptr;
    line.size = strlen(ptr);

    text[1] = line;
    printf("text[1].row = %s\n",text[1].row);
    printf("text[0].row = %s\n",text[0].row);
 
    ptr = "tell me your song";
    line.row = ptr;
    line.size = strlen(ptr);

    text[3] = line;
    printf("text[3].row = %s\n",text[3].row);

    return 0;
}


#! /usr/bin/tcc -run

#include <stdio.h>
#include <stdlib.h>
#include <string.h>


typedef struct slot
{
    ssize_t size;
    char *row;
}   slot;

    slot line;
    slot *text;
    slot *old;
    slot *new;

    char *ptr;

int main(void) {

    text = malloc(10*sizeof(slot));
    old  = malloc(10*sizeof(slot));
    new  = malloc(10*sizeof(slot));
   
    ptr = "this is my story";
    line.row = ptr;
    line.size = strlen(ptr);
    text[0] = line;


    ptr = "this is my song";
    line.row = ptr;
    line.size = strlen(ptr);
    text[1] = line;
  
 
    ptr = "tell me your song";
    line.row = ptr;
    line.size = strlen(ptr);
    text[3] = line;

    printf("text[3].row = %s\n",text[3].row);

    old = text;
    
    int j;

    for (j = 0; j < 10; j++) {old[j] = text[j];}
    printf("old[1].row = %s\n",old[1].row);
    printf("old[3].row = %s\n",old[3].row);

    slot newline;
    ptr = "hello world";
    newline.row = ptr;
    newline.size = strlen(ptr);

    for (j = 0; j < 10; j++) 
      {if (j != 3) {old[j] = text[j];}
       else        {old[j] = newline;}
      }
    printf("\n");
    printf("old[3].row = %s\n",old[3].row);
    printf("old[1].row = %s\n",old[1].row);



    return 0;
}


Add replacement functionality following initialization segment
Add replacement functionality following initialization segment
