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
Post a Comment