I have a small question.
How do I compute the number of files(which are specific such as .doc) in a directory in C++.

For example, if I have 10 files of type .doc format in a directory, how do I compute this value using C++.

Any help is appreciated.


depends on the operating system. MS-Windows you can use FindFirstFile() and FindNextFile(). *nix you can use opendir() and readdir(). Or boost libraries have a functions that are portable between operating systems. You can find c++ examples of both in the c++ code snippets here at DaniWeb.