count number of files with a given extension in a directory - C++?

前端 未结 3 477
慢半拍i
慢半拍i 2021-01-15 04:35

Is it possible in c++ to count the number of files with a given extension in a directory?

I\'m writing a program where it would be nice to do something like this (ps

3条回答
  •  攒了一身酷
    2021-01-15 04:48

    This kind of functionality is OS-specific, therefore there is no standard, portable method of doing this.

    However, using Boost's Filesystem library you can do this, and much more file system related operations in a portable manner.

提交回复
热议问题