fork(2) download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6. std::string progid;
  7. std::string clsid;
  8. vector<std::pair<std::string,std::string>> ids;
  9.  
  10. while(cin >> progid >> clsid ) {
  11. auto id = std::make_pair(progid,clsid);
  12. ids.push_back(id);
  13. }
  14. for(std::vector<std::pair<std::string,std::string>>::iterator it = ids.begin(); it != ids.end(); ++it) {
  15. progid = it->first;
  16. clsid = it->second;
  17. std::cout << "progid:" << it->first << " clsid:" << it->second <<endl;
  18. //std::cout << *(it.first) <<endl;
  19. }
  20. return 0;
  21.  
  22. }
Success #stdin #stdout 0s 16056KB
stdin
WINMGMTS {172BDDF8-CEEA-11D1-8B05-00600806D9B6}
LDAP {228D9A81-C302-11cf-9AA4-00AA004A5691}
stdout
progid:WINMGMTS clsid:{172BDDF8-CEEA-11D1-8B05-00600806D9B6}
progid:LDAP clsid:{228D9A81-C302-11cf-9AA4-00AA004A5691}