How to pass a const char* pointer to fts_open()
I assume you want to know how to pass this single path to the argv
(type char const **
) parameter of fts_open
. This parameter is described thus:
argv
Is a NULL terminated array of character pointers naming one or more paths that make up the file hierarchy.
So you need to create an array of length two whose elements are of type char*
. Put your path in the first element and put NULL in the second element. Like this:
char const *argv[] = { path, NULL };
You can now pass argv
to fts_open
.