When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.
#include <iostream>#include <filesystem>#include <map>#include <string>using namespace std;namespace fs = filesystem;int main(){ setlocale(LC_ALL, "Russian"); map <string, unsigned int> map_ext;// for (const fs::directory_entry& dir_entry : fs::recursive_directory_iterator("N:\\TestProgramExt\\")) for (const fs::directory_entry& dir_entry : fs::recursive_directory_iterator("//media//alex//SSD256//TestProgramExt")) { if (fs::is_regular_file(dir_entry)) { string ext = fs::path(dir_entry).extension().string(); ++map_ext[ext]; } } for (auto&& [ext, num] : map_ext) std::cout << ext << "\t" << num << std::endl; std::cin.get(); return 0;}
------------- Build: Debug in cbCppStudyLin (compiler: GNU GCC Compiler)---------------Target is up to date.Nothing to be done (all items are up-to-date).-------------- Run: Debug in cbCppStudyLin (compiler: GNU GCC Compiler)---------------Checking for existence: /home/alex/cppStudyLin/bin/Debug/cbCppStudySet variable: LD_LIBRARY_PATH=.:Executing: xterm -T cbCppStudyLin -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=:. /home/alex/cppStudyLin/bin/Debug/cbCppStudy (in /home/alex/cppStudyLin/.)Process terminated with status -1 (0 minute(s), 0 second(s))