[求助]目录与文件问题
大家好,我有好多文件,都需要在一些地方作一些类似的修改,所以想编个程序。但有个问题,就是如何搜索一个目录下的所有文件,并得到每一个文件的文件名?
我知道用system("dir >>a.txt")可以把文件名放入a.txt中,然后可以从a.txt中读取文件名,但这样好象有些不伦不类了,恳请高手指点迷津。在此先向高手们致谢
Standard C++ does not a file system library for you to use.
If you really want to do it, I recoommend using the popular boost fileystem library. I use that library for both windows and Linux systems. However, to install boost you need some efforts.
Another easy way to do it just on the windows system is "osdir.h". Try to google it.