i have to search for the .txt file and get info inside the file.
but i don't have the exact folder name for the .txt file.
Example:
At "C:\" have FOLDER name "abcfff";"abc231";"eeews";"abcdef";"123456";"sasw"
the 888.txt file which i looking for is located at C:\\abcde\\888.txt
the infomation i will have is path "C:" & file "888.txt"
for the FOLDER name infomation, i only can know the folder may start from "abc" and the folder name have maximum character "6".
my idea is get all the Folder Name from "C:\" and compare the name charater == 6 char & folder name should start with "abc", then i only will search the .txt file inside folder which is match with the criteria(which is search for file inside these folder("abcfff";"abc231","abcdef")).
is that have any tutorial which is same concept with this condition?
or you may have any idea to solve the problem?
Standard C++ does not come with anything to easily interrogate filesystems. You could use the Boost filesystem functions (requires installing Boost), or grab the dirent.h header and associated functions that someoen wrote for windows (they're standard on many other operating systems, but Windows likes to be different), or use the Win API as Hanst99 suggests.