I tried what is described in these links:
How can I pass character pointer reference to function and get affected value back?
Passing pointers (matrix) to a function in c
Passing an array as an argument to a function in C
but I can't. Dimension of my array is 3 and I initialized it like this:
char* trips[N][2] = {{"ANKARA", "10:00"}, {"BURSA", "11:00"}, {"IZMIR", "12:00"}, {"ISTANBUL", "13:00"}, {"ANTALYA", "14:00"}} so how can I pass this matrix into function?
My code is here and it doesn't sort or effect my array.
#include <stdio.h>
#include <stdlib.h>
#define N 10
typedef enum {
  SortByCity,
  SortByHour
 }SortType;
void merge(char**, int, int, int, SortType);
void mergeSort(char**, int, int, SortType);
void mergeSortByHour(char**, int, int, SortType);
int main(int argc, char *argv[]) {
 
 int i;
 
 char* trips[N][2] = {{"ANKARA", "10:00"}, {"BURSA", "11:00"}, {"IZMIR", "12:00"}, {"ISTANBUL", "13:00"}, {"ANTALYA", "14:00"}, {"ANKARA", "11:00"}, {"ISTANBUL", "13:00"}, {"ANKARA", "11:30"}, {"BURSA", "21:00"} , {"BURSA", "13:00"}};
 mergeSort(**trips, 0, N-1, SortByCity);
 
 for(i = 0; i < N; i++){
  printf("%-10s %s\n", trips[i][0],  trips[i][1]);
 }
 return 0;
}
void merge(char** T, int L, int M, int H, SortType S){
 
 int i, j, k;
    int N1 = M - L + 1;
    int N2 = H - M;
    
    char* LA[N1][2], RA[N2][2];
    
    for (i = 0; i < N1; i++){
     LA[i][S] = T[L+i][S];
     LA[i][1-S] = T[L+i][1-S];
 }
    for (j = 0; j < N2; j++){
     RA[j][S] = T[L+j][S];
     RA[j][1-S] = T[L+j][1-S];
 }
        
        
    i = 0;
    j = 0;
    k = L;
        
    while (i < N1 && j < N2)
    {
        if (strcmp(LA[i][S], RA[j][S]))
        {
            T[k][S] = RA[j][S];
            T[k][1-S] = RA[j][1-S];
            j++;
        }
        else
        {
            T[k][S] = LA[i][S];
            T[k][1-S] = LA[i][1-S];
            i++;
        }
        k++;
    }
}
void mergeSort(char** T, int L, int H, SortType S){
 
 if(L < H)
  return;
  
 int M = (L + H) / 2;
 mergeSort(T, L, M, S);
 mergeSort(T, M+1, H, S);
 merge(T, L, M, H, S);
  
}Please dont mark my question as duplicate because I dont understand the solutions explained in the site and can't solve my problem.
