How do you supply a wildcard to something and then it returns a list of all files that match it? For example, I want to parse all *.txt files in a directory, how would I go about doing that? In other languages it's been FindFirst and FindNext
This is a discussion on Finding files in a folder within the C++ Programming forums, part of the General Programming Boards category; How do you supply a wildcard to something and then it returns a list of all files that match it? ...
How do you supply a wildcard to something and then it returns a list of all files that match it? For example, I want to parse all *.txt files in a directory, how would I go about doing that? In other languages it's been FindFirst and FindNext
The method of doing this is operating system dependent: the C and C++ standards do not define this sort of functionality.
If you're under windows, the functions in the win32 SDK are FindFirstFile() and FindNextFile(), which are declared in the (windows specific) header <winbase.h>. On other operating systems, the function names are different.
<fake excitement>
I know this, I know this!!!!!
<bored again>
http://faq.cprogramming.com/cgi-bin/...&id=1044780608
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I support http://www.ukip.org/ as the first necessary step to a free Europe.