Not able to do char* to char**

You should ask yourself what is a realistic usable max number of file and go for that and just ignore files beyond that number for example (and issue a warning).