home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
OTHERUTI
/
MASTER-1.ZIP
/
SOURCE
/
CHAP06
/
CHAP06.LZH
/
OPENDIR.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-02
|
481b
|
23 lines
/* OPENDIR.C
Demonstrates use of the opendir(), readdir() and
closedir() functions.
*/
#include <stdio.h>
#include <dirent.h>
void main(void)
{
DIR * pDirectory;
struct dirent * pEntry;
pDirectory = opendir("C:\\SBM");
if (pDirectory == NULL)
puts("Unable to open the directory.\n");
else do {
pEntry = readdir( pDirectory );
if (pEntry != NULL) puts( pEntry->d_name );
} while (pEntry != NULL);
closedir( pDirectory );
}