Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
フォルダー内のすべてのファイルを開き、それらに対していくつかの操作を実行するループを実行したいと思います。しかし、渡ろうとすると
"*.*"
stream.open() で
、ファイルを開きません。(is_good()返品false)
is_good()
false
fstream stream; stream.open("*.*", fstream::out);
またはboostのFileSystem Apiのようなものを使用dirent.hして、ディレクトリ内のすべてのファイルを見つけて、または何か*.*に保存します。std::vector次に、ベクターをループして、すべてのファイルを開きます。
dirent.h
*.*
std::vector
for(int i = 0; i < files.size(); i++) { stream.open(files[i], fstream::out); }