Click to See Complete Forum and Search --> : How to use _findfirst and _findnext function


datang
May 21st, 1999, 04:03 AM
How to use _findfirst and _findnext function?

Franky Braem
May 21st, 1999, 04:25 AM
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);
}