When I use it to do 5 names all entries in the FName array points to the last name. Is there a better way to store entry.name() into an array of strings? Thanks.
Presumably, it was the lack of code tags that caused the [ i ] to disappear.
OP, you are creating an array of pointers. Each time you get a file name, you point to the memory location where that name is stored. So, at the end, all 5 pointers point to the same place.
You want to use strdup() to copy the data that entry.name points to, to another location, and point the ith element at that location.