New to programming: Is there a way to allow a user to decide which keys/values are considered in an unordered map?
I am very new to programming in general and am trying to teach myself C++. The program I am in the midst of writing is coming along nicely, in each version I am wanting to add funtionality. The program is a very basic “file sorter” that will sort “loose” files into folders based on file type for a given directory. in v0 everything was hardcoded so to change which directory it sorted you had to change the coding. V1 included an update so that it will prompt the user in the cli which directory they wanted to organize. now in v2 I am working on a way to prompt the user which folder types they want to include, currently the folders it creates are automatic and hardcoded: Images, documents, videos, etc… SO my question is this – currently the function that creates the folders references a unordered_map and my instict for an elegant solution is to prompt the user for each folder name asking a Y/N and then somehow void or turn off the folders that they dont want. Can I input functions in my map? Should I create a seperate function for each different folder? How might you solve this particular problem? Any help is appreciate, thanks so much!