How to use _findfirst and _findnext function?
Printable View
How to use _findfirst and _findnext function?
example :
struct _finddata_t c_file;
long hFile;
if ( (hFile = _findfirst("*.c", &c_file)) == -1L )
printf("No *.c files in current directory");
else
{
do
{
printf("%s\n", c_file.name);
} while ( _findnext(hFile, &c_file) == 0 )
_findclose(hFile);
}