I am not a C programmer, so I am not that familiar with C-string but now I have to use a C library so here is a shortened version of my code to demonstrate my problem:
change
char* matches[1];
to
char *matches = new matches[1];