Hi, How would I use fstream to open every text file in a folder? I am basically opening a text file (that i currently define the name of) running a loop of getline and storing the lines i need in a string array. Open next , repeat until all are done.
I would like to be able to point to a directory and then it opens the first file (does the loop) closes , opens next etc until it reaches the end. How would it find the first file does it search them by name or does it search by date? I assume these are all parameters you can set I am just not sure how!
Thank you, I have no experience with boost would you be able to give any example of how to do what im looking for within the boost system or at least point me in the right direction :P ? cheers!
Yea I have looked over it and checked it out before but im only a few weeks into programming part time , and I really cant make much sense of it. Is the boost file system the only solution for opening all text files in a folder when you dont know the names of the files ?
no win32 has something in the api and *nix has dirent.h
edit: but unless im writing an os specific app i would personally use boost, because the code to (un)include the files and code neccesary wouldnt make sense
well boost and win32 are apis, but dirent isnt. just google listing directories in c++ on {insert platform of choice}. it will give you links to techniques and code used