c++ - Can't read file lines into map/vector -


i have 2 files, contents of i'd read vector , map. first file has 1 int on each line, second file has string (key) , int (value).

    std::vector <int> groupids;     std::map <std::string, int> servergroups;      std::ifstream groupidsfile("groupids.txt");      if (groupidsfile) {         int lineid;          while (groupidsfile >> lineid) {             groupids.push_back(lineid);             std::cout << lineid;         }     }      std::sort(groupids.begin(), groupids.end());      std::ifstream commandsfile("commands.txt");      if (commandsfile) {         std::string command;         int commandid;          while (commandsfile >> command >> commandid) {             servergroups[command] = commandid;         }     } 

i have currently, nothing gets read files.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -