On MS-Windows, use FindFirstFile() and FindNextFile(). There are lots of examples how to use those two functions floating around, just use google to search for them.
>>I cannot use win32 because the program would be used as an example in a class introducing the C programming language
How to get those filenames is an os-specific task -- you will have to use win32 api functions. Yes, they can be used in console applications, just include windows.h. And it does not require any knowlege of c++. But it does require a little more then absolute beginner's knowledge. Need to know about loops, and structures and character arrays. If that is too much then you probably should pick a different example.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Online 21,950 posts
since Aug 2005