Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <map>
  2. #include <string>
  3. #include <vector>
  4.  
  5. class my_class
  6. {
  7. public:
  8. string str;
  9. my_class (const std::string& s) : str (s) {}
  10. };
  11.  
  12. int main(int argc, char** argv)
  13. {
  14. std::map<string,int> my_map;
  15. std::vector<my_class> my_vector;
  16.  
  17. my_map["abc"] = 23;
  18. my_map["def"] = 42;
  19.  
  20. my_vector.push_back (my_class ("foo"));
  21. my_vector.push_back (my_class ("bar"));
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement