How can i get a file extension from a file found using an iterator

Im doing a project right now where i need to iterate through a folder and put all the different file types into a map and then record how many of each file type there is in the folder

so ive gotten the scanner working so that it puts all the different files in a map, but now i need to make it more specific so it just puts the different file extensions in the map and increments each index of the map as it finds a new file with the same extension

so using a directory iterator like this: directory_iterator d(folder);, how can i figure out what the extension of the file is that its pointing to?
If that is boost's directory_iterator, just dereference it and call .extension(): http://www.boost.org/doc/libs/release/libs/filesystem/doc/reference.html#path-decomposition
Topic archived. No new replies allowed.